Answer the question
In order to leave comments, you need to log in
What am I doing wrong in the curl request?
I make a request:
$host = API_URL_USER_MEDIA;
$parameters = array(
'access_token'=>ACCESS_TOKEN,
'count'=>2
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $host);
curl_setopt($ch, CURLOPT_POST,true);
curl_setopt($ch, CURLOPT_POSTFIELDS,$parameters);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_TIMEOUT, 90);
$jsonData = json_decode(curl_exec($ch));
print_r($jsonData);
Answer the question
In order to leave comments, you need to log in
but who knows) you need to look at what curl_exec returns, and if it is false, curl_error
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question