Skip to content

Instantly share code, notes, and snippets.

@zzzarius
Created March 7, 2026 12:30
Show Gist options
  • Select an option

  • Save zzzarius/54320452f572ed8b87b7b692c82f06ee to your computer and use it in GitHub Desktop.

Select an option

Save zzzarius/54320452f572ed8b87b7b692c82f06ee to your computer and use it in GitHub Desktop.
curl examples
curl --request GET http://example.com
curl --request GET http://example.com?key=value
curl --request POST http://example.com
curl --request PUT http://example.com
curl --request DELETE http://example.com
curl --request PATCH http://example.com
curl --request POST --header 'Content-Type: application/xml' --data '<key>value</key>' http://example.com
curl --request POST --header 'Content-Type: application/json' --data '{"key":"value"}' http://example.com
curl --request POST --header 'Content-Type: multipart/form-data' --form 'key=value' http://example.com
curl --request GET --output file.txt http://example.com
curl --request POST --form 'file=@/path/to/file' http://example.com
curl --request GET --header 'X-My-Header: 123' http://example.com
curl --request GET --cookie 'key=value' http://example.com
curl --request GET --user 'username:password' http://example.com
curl --request GET --proxy http://proxy.example.com:8080 http://example.com
curl --request GET --header 'Authorization: Bearer token' http://example.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment