收藏
回答

小游戏,post数据丢失,偶发的.要怎么处理?

引擎:layabox 1.8x

基础调试库:2.16.0

问题现象:

手机A,ios系统14.4.2,微信版本8.04,可以正常向服务端发送post,后端正常解析.


手机B,ios系统14.4.1,微信版本8.0.4,可以正常向服务器发送pos,后端无法获取post数据流;

客户端post时候已经设置 "Content-Type","application/x-www-form-urlencoded"

服务端语言:PHP 5.4x

获取post代码:

//获取参数
$data = file_get_contents("php://input");
回答关注问题邀请回答
收藏

1 个回答

  • 烟卷
    烟卷
    2021-04-10

    服务端抓取数据错误数据:

      3 array (

      4   'USER' => 'nobody',

      5   'HOME' => '/',

      6   'FCGI_ROLE' => 'RESPONDER',

      7   'SCRIPT_FILENAME' => '/data/www/game/ccbp/server/p7_alpha/public/s1/index.php',

      8   'QUERY_STRING' => '',

      9   'REQUEST_METHOD' => 'POST',

     10   'CONTENT_TYPE' => 'application/x-www-form-urlencoded',

     11   'CONTENT_LENGTH' => '0',

     12   'SCRIPT_NAME' => '/p7_alpha/public/s1/index.php',

     13   'REQUEST_URI' => '/p7_alpha/public/s1/index.php',

     14   'DOCUMENT_URI' => '/p7_alpha/public/s1/index.php',

     15   'DOCUMENT_ROOT' => '/data/www/game/ccbp/server',

     16   'SERVER_PROTOCOL' => 'HTTP/1.1',

     17   'HTTPS' => 'on',

     18   'GATEWAY_INTERFACE' => 'CGI/1.1',

     19   'SERVER_SOFTWARE' => 'nginx/1.8.0',

     20   'REMOTE_ADDR' => '218.66.157.218',

     21   'REMOTE_PORT' => '60732',

     22   'SERVER_ADDR' => '10.23.214.205',

     23   'SERVER_PORT' => '443',

     24   'SERVER_NAME' => 'ccbph5-api.wanxiami.cn',

     25   'REDIRECT_STATUS' => '200',

     26   'HTTP_HOST' => 'ccbph5-api.wanxiami.cn',

     27   'HTTP_CONNECTION' => 'keep-alive',

     28   'HTTP_CONTENT_LENGTH' => '0',

     29   'HTTP_CONTENT_TYPE' => 'application/x-www-form-urlencoded',

     30   'HTTP_ACCEPT_ENCODING' => 'gzip,compress,br,deflate',

     31   'HTTP_USER_AGENT' => 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/8.0.4(0x18000423) NetType/WIFI Language/zh_CN',

     32   'HTTP_REFERER' => 'https://servicewechat.com/wx5dabc6b38370541e/0/page-frame.html',

     33   'PHP_SELF' => '/p7_alpha/public/s1/index.php',

     34   'REQUEST_TIME_FLOAT' => 1618037841.7265279,

     35   'REQUEST_TIME' => 1618037841,



    服务端抓取正确日志:

     41   'USER' => 'nobody',

     42   'HOME' => '/',

     43   'FCGI_ROLE' => 'RESPONDER',

     44   'SCRIPT_FILENAME' => '/data/www/game/ccbp/server/p7_alpha/public/s1/index.php',

     45   'QUERY_STRING' => '',

     46   'REQUEST_METHOD' => 'POST',

     47   'CONTENT_TYPE' => 'application/x-www-form-urlencoded',

     48   'CONTENT_LENGTH' => '230',

     49   'SCRIPT_NAME' => '/p7_alpha/public/s1/index.php',

     50   'REQUEST_URI' => '/p7_alpha/public/s1/index.php',

     51   'DOCUMENT_URI' => '/p7_alpha/public/s1/index.php',

     52   'DOCUMENT_ROOT' => '/data/www/game/ccbp/server',

     53   'SERVER_PROTOCOL' => 'HTTP/1.1',

     54   'HTTPS' => 'on',

     55   'GATEWAY_INTERFACE' => 'CGI/1.1',

     56   'SERVER_SOFTWARE' => 'nginx/1.8.0',

     57   'REMOTE_ADDR' => '59.57.152.138',

     58   'REMOTE_PORT' => '4122',

     59   'SERVER_ADDR' => '10.23.214.205',

     60   'SERVER_PORT' => '443',

     61   'SERVER_NAME' => 'ccbph5-api.wanxiami.cn',

     62   'REDIRECT_STATUS' => '200',

     63   'HTTP_HOST' => 'ccbph5-api.wanxiami.cn',

     64   'HTTP_CONTENT_TYPE' => 'application/x-www-form-urlencoded',

     65   'HTTP_ACCEPT_ENCODING' => 'gzip, deflate, br',

     66   'HTTP_CONNECTION' => 'keep-alive',

     67   'HTTP_ACCEPT' => '*/*',

     68   'HTTP_USER_AGENT' => 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_4_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/8.0.4(0x18000423) NetType/WIFI Language/zh_CN',

     69   'HTTP_REFERER' => 'https://servicewechat.com/wx5dabc6b38370541e/0/page-frame.html',

     70   'HTTP_CONTENT_LENGTH' => '230',

     71   'HTTP_ACCEPT_LANGUAGE' => 'zh-cn',

     72   'PHP_SELF' => '/p7_alpha/public/s1/index.php',

     73   'REQUEST_TIME_FLOAT' => 1618038038.8492811,

     74   'REQUEST_TIME' => 1618038038,



    2021-04-10
    有用
    回复
登录 后发表内容
问题标签