9951 explained code solutions for 126 technologies

curlHow to post JSON data

curl -H "Content-Type: application/json" -X POST -d '{"var1":"val1"}' https://example.org/script.phpctrl + c
Content-Type: application/json

set JSON content type for our request


make this a POST request


specify data we want to post


JSON in plain text we're going to post


example script to post data to