POST /autoPalletCAN?pEvent=openBagSignal HTTP/1.1
Host: 192.168.11.1:9000
User-Agent: workerman/http-client
Connection: keep-alive
Content-Type: application/x-www-form-urlencoded, application/json
Content-Length: 627
RT
如果设置了的话Content-Type 会出现多个值,在某些接口上会报错。
上面是抓色的结果。要发送的Content-Type 是 application/json 但是会出现多个值。
用是这么用的
$http1->request($url, [
'method' => 'POST',
'version' => '1.1',
'headers' => ['Connection' => 'keep-alive'],
'headers' => ['Content-type'=>'application/json'],
'data' => [$post],
'success' => function ($response) {
echo $response->getBody();
},
'error' => function ($exception) {
$ident = 'SAC2WorkStation';
new logErr($ident,$exception);
}
]);
上次设置Connection好像出有类似问题。
Request.php 这样改一下解决了。
已经在v0.1.3版本修复