Skip to content

curl

force GET request and get headers

If you just want the headers and use -I, curl will do a HEAD request, so you can force to do a GET request:

curl -X GET -I https://example.com/

--next

run requests after another with a single curl command:

curl https://httpbin.org/get --next -X POST --data "abc=xyz" https://httpbin.org/post --next https://httpbin.org/headers

blog post about this, source

uploading files

form upload

form upload will include things like a filename and the content-type.

curl -F 'file=@screenshot.png' https://example.com/post

just upload the file

just the body of the file will be uploaded here.

curl -X PUT -H "content-type: video/mp4" --data-binary '@a54dfef2-3006-4702-8eaa-3f28bee43e1a.mp4' https://example.com/video.mp4