Skip to content

CLI Commands

Available CLI commands.

HTTP Methods

GET

fasthttp get https://api.example.com/data

With query parameters:

fasthttp get "https://api.example.com/search?q=test&page=1"

POST

fasthttp post https://api.example.com/users --json '{"name": "John"}'

PUT

fasthttp put https://api.example.com/users/1 --json '{"name": "Jane"}'

PATCH

fasthttp patch https://api.example.com/users/1 --json '{"age": 25}'

DELETE

fasthttp delete https://api.example.com/users/1

Output Format

Second argument determines output:

Format Description
status Status code only (default)
json JSON response body
text Response text
headers Response headers
all Everything together

Examples

Status Only

$ fasthttp get https://api.example.com/data status
200

JSON Response

$ fasthttp get https://api.example.com/data json
{"id": 1, "name": "John"}

All Info

$ fasthttp get https://api.example.com/data all
Status: 200
Elapsed: 234.56ms
Headers: {...}
Body: {...}