Raw POST using cURL in PHP
We can do a raw POST with cURL library, which can send text data to server, such as json, xml, html and so on. Just convert data to string, and put in curl_setopt($curl, CURLOPT_POSTFIELDS, $data)
。
Example
Submit JSON data
Use it.
reponse.php
Output
Submit XML data
Use it.
reponse.php
Output