cURL post JSON data on Windows

On Windows, the key to send JSON data is double-quotes like this


-d "{\"name\":\"Spring Forever\"}"

cURL to POST a JSON data


 curl -X POST localhost:8080/books
	-H "Content-type:application/json" 
	-d "{\"name\":\"Spring Forever\",\"author\":\"pivotal\"}"

References

About the Author

author image
mkyong
Founder of Mkyong.com, love Java and open source stuff. Follow him on Twitter. If you like my tutorials, consider make a donation to these charities.

Comments

avatar