Update cheatsheets

This commit is contained in:
ivuorinen
2025-03-15 00:18:14 +00:00
parent 605e1cdfd8
commit 367b1e4cb2
7 changed files with 56 additions and 23 deletions

View File

@@ -14,7 +14,7 @@ source: https://github.com/tldr-pages/tldr.git
- Print specific parts of the content (`H`: request headers, `B`: request body, `h`: response headers, `b`: response body, `m`: response metadata):
`http --print {{H|B|h|b|m|Hh|Hhb|...}} {{https://example.com}}`
`http {{[-p|--print]}} {{H|B|h|b|m|Hh|Hhb|...}} {{https://example.com}}`
- Specify the HTTP method when sending a request and use a proxy to intercept the request:
@@ -26,7 +26,7 @@ source: https://github.com/tldr-pages/tldr.git
- Authenticate to a server using different authentication methods:
`http --auth {{username:password|token}} --auth-type {{basic|digest|bearer}} {{GET|POST|...}} {{https://example.com/auth}}`
`http {{[-a|--auth]}} {{username:password|token}} {{[-A|--auth-type]}} {{basic|digest|bearer}} {{GET|POST|...}} {{https://example.com/auth}}`
- Construct a request but do not send it (similar to a dry-run):
@@ -34,8 +34,8 @@ source: https://github.com/tldr-pages/tldr.git
- Use named sessions for persistent custom headers, auth credentials and cookies:
`http --session {{session_name|path/to/session.json}} {{--auth username:password https://example.com/auth API-KEY:xxx}}`
`http --session {{session_name|path/to/session.json}} {{[-a|--auth]}} {{username}}:{{password}} {{https://example.com/auth}} {{API-KEY:xxx}}`
- Upload a file to a form (the example below assumes that the form field is `<input type="file" name="cv" />`):
`http --form {{POST}} {{https://example.com/upload}} {{cv@path/to/file}}`
`http {{[-f|--form]}} {{POST}} {{https://example.com/upload}} {{cv@path/to/file}}`