public function vtest(){
$params = array(
'filename'=> new CURLFile("/Users/zorozdd/Desktop/image.png"),
);
$header[] = 'Authorization: Basic ' . base64_encode('appid:key');
$header[] = 'Accept: application/json';
$header[] = 'Content-type: multipart/form-data';
//curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($car)); ($c, CURLOPT_HTTPHEADER, array('Content-type: multipart/form-data'));
$ch = curl_init();
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
curl_setopt($ch, CURLOPT_URL, "https://api.im.jpush.cn/v1/resource?type=image");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
curl_close($ch);
var_dump(json_decode($response));
}
$params = array(
'filename'=> new CURLFile("/Users/zorozdd/Desktop/image.png"),
);
$header[] = 'Authorization: Basic ' . base64_encode('appid:key');
$header[] = 'Accept: application/json';
$header[] = 'Content-type: multipart/form-data';
//curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($car)); ($c, CURLOPT_HTTPHEADER, array('Content-type: multipart/form-data'));
$ch = curl_init();
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
curl_setopt($ch, CURLOPT_URL, "https://api.im.jpush.cn/v1/resource?type=image");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
curl_close($ch);
var_dump(json_decode($response));
}