Answer the question
In order to leave comments, you need to log in
Why is $data not coming?
The problem is that when accessing the api (I hid the URL with an asterisk), $postdata does not come if I make a request from php.
Tell me what's wrong, please?
$data = array("category" => 2);
$postdata = http_build_query($data);
$options = array(
'http' => array(
'header' => 'Content-type: application/json; charset=utf-8',
'method' => 'GET',
'content' => $postdata
)
);
$stream = stream_context_create($options);
$api_url = "****";
$result = file_get_contents($api_url, false, $stream);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question