Curl cheat sheet, for web developement

HTTP Request Specify Method by -X Form: curl -X <METHOD> <URI> By default, it uses GET method curl https://www.google.com/ # same as curl -X GET https://www.google.com/ Use Post simply by: curl -X POST https://www.example.com/ GET Get entire document of the website in terminal curl https://www.google.com/ POST curl -X POST https://example.com/ More complex, pass data, -d and header -H to server. Below shows POST with json body curl -d '{"option": "value", "something": "anothervalue"}' \ -H "Content-Type: application/json" \ -X POST https://example....

December 18, 2022 · 1 min · Derry