Usage
Learn how to use reqsh effectively for your API testing workflow.
Starting a Session
Launch reqsh by typing reqsh in your terminal. You'll be dropped into the interactive REPL with a prompt.
reqsh
1
reqsh
2
reqsh>
Setting a Base URL
Use the base command to set a base URL. All subsequent requests will be relative to this URL.
reqsh
1
reqsh> base https://api.example.com
Making Requests
Type the HTTP method followed by the path. Use ::send to execute.
reqsh
1
reqsh> GET /users
2
.....> ::send
Request Body
Leave a blank line after headers to start writing the body.
reqsh
1
reqsh> POST /users
2
.....> Content-Type: application/json
3
.....>
4
.....> {"name": "Alice", "email": "alice@example.com"}
5
.....> ::send
Query Parameters
Add query parameters with param: lines.
reqsh
1
reqsh> GET /users
2
.....> param: page=1
3
.....> param: limit=20
4
.....> ::send
Absolute URLs
You can use absolute URLs directly without setting a base URL.
reqsh
1
reqsh> GET https://api.github.com/users/hars-21
2
.....> ::send
Headers
Global Headers
Add persistent headers that apply to all requests in the session.
reqsh
1
reqsh> header Authorization Bearer sk_test_123
2
reqsh> header Content-Type application/json
Per-Request Headers
Add headers to individual requests.
reqsh
1
reqsh> GET /users
2
.....> X-Custom-Header: value
3
.....> ::send
View and Remove Headers
reqsh
1
reqsh> headers
2
reqsh> unset header Authorization
Response Handling
After each request, reqsh displays:
- HTTP version (e.g.,
HTTP/1.1) - Status code and status text (color-coded: green for 2xx, yellow for 4xx, red for 5xx)
- Response time in milliseconds
- Full response headers
- Pretty-printed JSON body (auto-detected from
Content-Type) or raw text
reqsh
1
HTTP/1.1200 OK 142ms
2
content-type: application/json
3
date: Mon, 01 Jan 2024 00:00:00 GMT
4
5
{
6
"id": 1,
7
"name": "Alice"
8
}