By Alvin Alexander. Last updated: April 6, 2024
As a quick note curl/JSON note, I recently learned that you can use the following curl
script to post JSON data to a web service:
curl \ --header "Content-type: application/json" \ --request POST \ --data '{"symbol":"GOOG","price":"600.00"}' \ http://localhost:8080/stocks/saveJsonStock
If you're familiar with the curl
command and JSON web services, this should make sense.
If you want to learn more about using curl with JSON and REST web services, here are links to other curl shell scripts I've written:
- How to view HTTP headers from the command line
- A curl shell script to download a URL and test website speed
For more information, see the (very long) curl man page.