![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
curl
teng316
走投无路的PHPer,开始接触Python和golang喽~~~
展开
-
curl post请求包含数组参数
场景描述:使用curl方法,post请求接口,参数中包含数组格式的值,又不想把数组转换成json,这时候就需要对curl方法做一点点改动了。 curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post_data)); // 这里是关键,把数组参数做一步转换curl方法post一个数组$r = $this->curl_post($url, $data);$list = json_decode($r,true);function c原创 2021-11-16 10:33:56 · 1963 阅读 · 0 评论 -
curl Content type ‘application/x-www-form-urlencoded;charset=UTF-8‘ not supported
使用curl请求java接口,返回报错array(5) { ["timestamp"]=> string(19) "2021-11-10 11:20:26" ["status"]=> int(415) ["error"]=> string(22) "Unsupported Media Type" ["message"]=> string(76) "Content type 'application/x-www-form-urlencoded;char原创 2021-11-10 11:24:13 · 3443 阅读 · 0 评论 -
php封装curl方法、批量请求
curl批量curl原创 2020-09-20 22:27:24 · 508 阅读 · 0 评论