Skip to content
This repository has been archived by the owner on Sep 3, 2024. It is now read-only.

Latest commit

 

History

History
16 lines (14 loc) · 614 Bytes

curl.md

File metadata and controls

16 lines (14 loc) · 614 Bytes

curl

-X <HTTP_VERB> ........ use a certain http verb
--data-binary <data> .. keep data as-is, don't attach newlines
--cookie <token> ...... pass in a cookie
-H <header> ........... add a header
-d <data> ............. pass in data
-L .................... follow redirects
  • Cookies: Retrieve from browser tools network tab
  • Headers: curl -H "Content-Type: application/json" http://localhost:3000
  • Data: curl -H "Content-Type: application/json" -d \ '{"username":"xyz","password":"xyz"}' http://localhost:3000/api/login
  • Data-Binary: curl --data-binary @myFile.json http://localhost:3000/api