can not, nusoap and native soap apparently send only XML , anyway I started using cURL but I'm having a problem that I can not decipher what it is. I hope you can help me.
I show the case
$header = array();
$header[] = "Content-Type: application/json";
$header[] = "cache-control: no-cache";
$array = json_encode($array);
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, "https://test.correosexpress.com/wspsc/apiRestGrabacionEnvio/json/grabacionEnvio");
curl_setopt($curl, CURLOPT_HTTPHEADER, $header);
curl_setopt($curl, CURLOPT_USERPWD, "xxxxxx:xxxxx");
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $array);
$Response = curl_exec($curl);
$errorNo = curl_errno($curl);
if($errorNo){
$error = curl_error($curl);
echo $error;
return false;
}
$info = curl_getinfo($curl);
var_dump($info);
curl_close($curl);
var_dump($Response);
the $ array is the json that I'm trying to send.
the answer I get is the following
C:\wamp64\www\.......\newPedido.php:98:
array (size=26)
'url' => string 'https://test.correosexpress.com/wspsc/apiRestGrabacionEnvio/json/grabacionEnvio' (length=79)
'content_type' => null
'http_code' => int 200
'header_size' => int 184
'request_size' => int 258
'filetime' => int -1
'ssl_verify_result' => int 19
'redirect_count' => int 0
'total_time' => float 30.311
'namelookup_time' => float 0.125
'connect_time' => float 0.141
'pretransfer_time' => float 0.203
'size_upload' => float 1132
'size_download' => float 0
'speed_download' => float 0
'speed_upload' => float 37
'download_content_length' => float -1
'upload_content_length' => float 1132
'starttransfer_time' => float 0.234
'redirect_time' => float 0
'redirect_url' => string '' (length=0)
'primary_ip' => string 'xxx.xxx.xxx.xxx' (length=14)
'certinfo' =>
array (size=0)
empty
'primary_port' => int 443
'local_ip' => string 'xxx.xxx.xxx.xxx' (length=13)
'local_port' => int 54054
C:\wamp64\www\......\newPedido.php:101:string '' (length=0)
I hope that with that is enough information for an answer. Thank you very much.