Convert Terminal cURL to PHP cURL Script Convert Terminal cURL to PHP cURL Script curl curl

Convert Terminal cURL to PHP cURL Script


Copy your terminal curl script and import it to Postman. Then convert it to PHP CURL from export options. No need to transform manually.

Ref -

  1. https://www.getpostman.com/docs/importing_curl
  2. How to export specific request to file using postman


It worked after adding this line to the cURL:

curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json; charset=UTF-8'));