用工具postman请求没问题,可以返回数据,用curl请求却一直转圈
postman请求
$data = '{"token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJ1c2VyTWFuYWdlciIsImV4cCI6MTU5NjE4MzcxNSwidXNlck5hbWUiOiI5MTExMDExNjc2MDExNjk3ME0iLCJpYXQiOjE1OTYxODAxMTV9.S1DN9_GvPe1DKhqWCEgKTGcnTgw4mNZVhkA1q6B7iyc","skus":[{"skuNo":"0000000018","mainImgs":[{"imgUrl":"http://img.city-office.com.cn/images/201907/goods_img/775806_P_15632062798287.png","thumbUrl":"http://img.city-office.com.cn/images/201907/thumb_img/775806_thumb_P_15632112500464.jpg","imgOriginal":"http://img.city-office.com.cn/images/201907/source_img/775806_P_15632094645050.png","imgSort":1,"imgDesc":""},{"imgUrl":"http://img.city-office.com.cn/images/201907/goods_img/775806_P_15632103189750.png","thumbUrl":"http://img.city-office.com.cn/images/201907/thumb_img/775806_thumb_P_15632064878548.jpg","imgOriginal":"http://img.city-office.com.cn/images/201907/source_img/775806_P_15632079273586.png","imgSort":2,"imgDesc":""},{"imgUrl":"http://img.city-office.com.cn/images/201907/goods_img/775806_P_15632097173296.jpg","thumbUrl":"http://img.city-office.com.cn/images/201907/thumb_img/775806_thumb_P_15632143692520.jpg","imgOriginal":"http://img.city-office.com.cn/images/201907/source_img/775806_P_15632115758371.jpg","imgSort":3,"imgDesc":""}],"detailsImgs":[{"imgUrl":"http://img.city-office.com.cn/images/201907/goods_img/775806_P_15632062798287.png","thumbUrl":"http://img.city-office.com.cn/images/201907/thumb_img/775806_thumb_P_15632112500464.jpg","imgOriginal":"http://img.city-office.com.cn/images/201907/source_img/775806_P_15632094645050.png","imgSort":1,"imgDesc":""},{"imgUrl":"http://img.city-office.com.cn/images/201907/goods_img/775806_P_15632103189750.png","thumbUrl":"http://img.city-office.com.cn/images/201907/thumb_img/775806_thumb_P_15632064878548.jpg","imgOriginal":"http://img.city-office.com.cn/images/201907/source_img/775806_P_15632079273586.png","imgSort":2,"imgDesc":""},{"imgUrl":"http://img.city-office.com.cn/images/201907/goods_img/775806_P_15632097173296.jpg","thumbUrl":"http://img.city-office.com.cn/images/201907/thumb_img/775806_thumb_P_15632143692520.jpg","imgOriginal":"http://img.city-office.com.cn/images/201907/source_img/775806_P_15632115758371.jpg","imgSort":3,"imgDesc":""}]}],"sign":"f43662782d65558873e0194bee7b6032"}';
$header = array(
'Content-Type:application/json;charset=UTF-8'
);
//var_dump($url,$data);
$url = 'http://k25492p871.wicp.vip:26917/DS-API/sku/receive/imgs';
$ch = curl_init(); //初始化CURL句柄
curl_setopt($ch, CURLOPT_URL, $url); //设置请求的URL
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST,true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_HTTPHEADER,$header);
$output = curl_exec($ch);
curl_close($ch);
var_dump($output);
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…