0

Sorry, if my question is too beginner. So I am creating Rest API.

I have a client:

<?php
$ch = curl_init( $sUrl );
# Setup request to send json via POST.
$sRequest = json_encode($aRequestData);
curl_setopt( $ch, CURLOPT_POSTFIELDS, "postvar1=value1&postvar2=value2&postvar3=value3");
curl_setopt( $ch, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));
# Return response instead of printing.
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
# Send request.
$result = curl_exec($ch);
curl_close($ch);
# Print response.
echo "<pre>$result</pre>";
?>

And I have the API, where I would like to process the POST data.

How can I see the POST data in the API and after that process? Is there any superglobal variable or anything else?

I tried the $_POST,the $_REQUEST, but not.

Thank you for your help in advance!

Árpád Jó
  • 11
  • 1
  • 5

0 Answers0