I am using curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); and try to listen to an url. The Url seems to be working fine (at least on postmen i get a full json).
The Problem: i do not get the json string i am hoping for with curl_exec but instead i get a string with a single space in it. Normally i would assume there is a problem with my curl but since a string(0) meens false and mine is a string(1) i must have done something right. sadly i just cant seem to find anything on the net on why it isn´t giving me the full site as string.
Where should i start looking for the problem?
my code for Curl:
$curl = curl_init();
curl_setopt($curl,CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
// Send the request & save response to $resp
$resp = curl_exec($curl);
var_dump($resp);
Thanks a lot!
source https://stackoverflow.com/questions/68966724/why-is-curl-exec-returning-string1-when-the-url-returns-a-json-on-postm
Comments
Post a Comment