Headers & Auth
`-H`、`-u`、`-A`、`-e`、`-b`、Bearer / Basic Auth
贴入命令后即时输出 `requests` 或 `httpx` 代码,保留请求头、query、body、认证、表单和常见网络选项。
$ curl https://api.example.com/messages \
-H "Authorization: Bearer sk-demo" \
-H "Content-Type: application/json" \
-d '{"message":"hello"}'
import requests
headers = {
"Authorization": "Bearer sk-demo",
"Content-Type": "application/json",
}
payload = {
"message": "hello",
}
response = requests.post(
"https://api.example.com/messages",
headers=headers,
json=payload,
)
Playground
Input
Output
Detected
Notes
Coverage
`-H`、`-u`、`-A`、`-e`、`-b`、Bearer / Basic Auth
`-d`、`--data-*`、`--json`、URL encoded、原始文本、JSON
`-F` / `--form` 文本字段与文件字段,自动生成 `with open(...)`
`-G`、`-L`、`-k`、`--compressed`、`--max-time`