~/cheatsheets/curl
Published on

curl

Options

OptionDescriptionExample
-XRequest Type-X POST
-HHeader-H "Content-Type: application/json"
-d --datadata-H "Content-Type: application/json" -d '{"message": "a request body example"}'
-d --datadata-H "Content-Type: x-www-form-encoded" -d 'name=bob'
-iInclude response headers/status code in output-i
-sSilent or quiet mode-s
-m --max-timeMaximum time in seconds that you allow the whole operation to take-m 60

Examples

POST Request

Authorization: Bearer $TOKEN" -H 'content-Type: application/json' -X POST 'http://localhost:3002/v1/question/' -d '{"question": "what is 1 + 1"}'