I want to get info from an api and the code is like:
<?php
$curl = curl_init();
$authorization = "Authorization: Token token='xxxxxx'";
$header = curl_setopt($curl, CURLOPT_HTTPHEADER, array($authorization));
curl_setopt($curl, CURLOPT_URL, "https://customr.heliumdev.com/api/v1/customers/xxxx");
$result = curl_exec($curl);
if(!curl_exec($curl)){
print_r('Error: "' . curl_error($curl) . '" - Code: ' .curl_errno($curl)."<br>");
}
curl_close($curl);
print_r(json_decode($result));
?>
and I got the error like Error: "Illegal characters found in URL" - Code: 3
the origin curl should be curl https://customr.heliumdev.com/api/v1/customers/xxxx --header "Authorization: Token token="xxx""
, any idear about the illegal characters?