CLI HTTP - GradedJestRisk/web-training GitHub Wiki
List:
- httpie;
- curl;
- wget.
General:
- send (default GET):
http perdu.com
- send VERB:
http GET perdu.com
- print header only:
http -h perdu.com
- send data
- in query params:
http --header GET https://www.google.com/search q==test
(for search ?q=test) - in form:
http -f POST httpbin.org/post hello=World
- in query params:
Get curl <URL>
curl www.perdu.com <html><head><title>Vous Etes Perdu ?</title></head><body><h1>Perdu sur l'Internet ?</h1><h2>Pas de panique, on va vous aider</h2></body></html>
Store to file curl <OUTPUT_FILE_PATH> <URL>
curl -o index.html www.perdu.com head index.html <html><head><title>Vous Etes Perdu ?</title></head><body><h1>Perdu sur l'Internet ?</h1><h2>Pas de panique, on va vous aider</h2></body></html>
<coede> curl --header "Content-Type: application/json" -d '{id:1}' http://localhost:3000/recipes </code></coede>
List:
- headers:
-H, --header + <HEADER>
- output to file
-o + <OUTPUT_FILE_PATH>
You can get them from Mozilla:
- dev tools
- network
- copy / copy as CURL