1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-21 22:22:07 +02:00
tldr/pages.pl/common/http.md
Michal ccd20f1f3f update http
updated
2020-04-19 13:31:16 +01:00

710 B

http

HTTPie: HTTP client, ma być łatwiejszy w użyciu niż cURL. Więcej informacji: https://httpie.org.

  • Pobierz adres URL do pliku:

http -d {{example.org}}

  • Wyślij dane zakodowane w formularzu:

http -f {{example.org}} {{name='bob'}} {{profile_picture@'bob.png'}}

  • Wyślij obiekt JSON:

http {{example.org}} {{name='bob'}}

  • Określ metodę HTTP:

http {{HEAD}} {{example.org}}

  • Dołącz dodatkowy nagłówek:

http {{example.org}} {{X-MyHeader:123}}

  • Podaj nazwę użytkownika i hasło do uwierzytelnienia serwera:

http -a {{username:password}} {{example.org}}

  • Określ surowe ciało żądania za pośrednictwem stdin:

cat {{data.txt}} | http PUT {{example.org}}