How to use CURL with Proxy

This post will be demonstrating how to use curl with proxy in PHP and Linux command line. What is additional parameter we need to pass while using curl via proxy. So I am starting with proxy configuration in PHP curl. 1) PHP curl with proxy $url = 'http://localhost/path/'; $proxy =…

Post JSON data via PHP cURL

Post JSON data via PHP cURL We can Post JSON data via PHP curl by using header Content-Type: application/json in CURLOPT_HTTPHEADER. Below is working code demonstration of PHP curl with post json¬†field. <?php $url = ''; $jsonString = json_encode(array("key" => "value")); // You can directly replace your JSON string with…
TechieRoopTutorials, Programming Solutions, Tips & Tricks 2016