php - Error: "Illegal characters found in URL" - Code: 3 -
i want info api , code 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 got error error: "illegal characters found in url" - code: 3
the origin curl should curl https://customr.heliumdev.com/api/v1/customers/xxxx --header "authorization: token token="xxx""
, idear illegal characters?
i not reproduce problem.
however, suggest avoid unnecessary double-execution of curl_exec , use $result instead...
... $result = curl_exec($curl); if (!$result) { ... }
Comments
Post a Comment