php curl请求(自用)
/**
* curl post json请求
* @param $url
* @param $json_str
* @return array
*/
function httpPostJson($url, $json_str)
{
header("Content-type:application/json;charset=utf-8");
//curl方式发送请求
$ch = curl_init();
//设置请求为post
curl_setopt($ch,
原创
2020-12-10 11:54:34 ·
66 阅读 ·
0 评论