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\"}"
Great. This solved my problem.
I appreciate your posts. Thank you!
Muito obrigado!
Thank you! I couldn’t figure out why the same command worked on Linux and not on Windows. This was the simple solution I needed. 🙂
Thank you!
Obrigado!
Gracias!