程序里面使用 curl 访问接口, 报400错误,win 下正常, 上到 linux 报400 错误,postman 和浏览器都能正常访问接口,linux
查阅资料后反现是** curl 版本问题**,浏览器
当curl 使用 post 方式访问接口,而post 数据又为空时就会出现这种状况,curl
解决: 添加任意一个 post 字段post
curl_setopt($ch, CURLOPT_POSTFIELDS, 'xx=xxx');