How do I POST JSON with Curl? [JavaScript/AJAX Code]

To post JSON data using Curl, you need to set the Content-Type of your request to application/json. This is done using the -H "Content-Type: application/json" command line parameter. JSON data is passed with the curl -d command line option. Double quotes in JSON are escaped with \". Click Run to execute Curl POST JSON example online and see results. The JavaScript/AJAX code was automatically generated for the Curl POST JSON example.
Loading...