I am attempting to learn cURL to use a JSON web service. I tried a couple tutorials online and none seem to be helping.
I want to get to this web address: https://uat.petfirsthealthcare.com/pfh.service.webservices/coreservice.svc/json/GetColorList
and return the results to use in another call. But when I try, I don’t get any thing back.
I used this:
$request = 'https://uat.petfirsthealthcare.com/pfh.service.webservices/coreservice.svc/json/GetColorList';
curl_init($request);
curl_setopt($session, CURLOPT_HEADER, false);
curl_setopt($session, CURLOPT_RETURNTRANSFER, true);
$response = curl_exe($session);
curl_close($session);
echo $response;
When you just go to the URL it return JSON just fine. Thanks for any help you can provide!
This is TESTED and WORKS!