The request is badly formed.

curl post请求url链接地址报错 HTTP Error 400. The request is badly formed.

解决办法:

url中包含空格,使用urlencode去掉空格。

//$timestamp 2022-05-07 15:03:00
$url="http://xxx.com?id=".$id."&timestamp=".$timestamp;

替换为

$url="http://xxx.com?id=".$id."&timestamp=".urlencode($timestamp);

0 评论
内联反馈
查看所有评论