Skip to content

Latest commit

 

History

History
95 lines (73 loc) · 2.2 KB

File metadata and controls

95 lines (73 loc) · 2.2 KB

Usage Guide

Quick Start

# Install
pip install httping-cli

# Basic GET
httping get https://api.example.com/users

# POST with JSON body
httping post https://api.example.com/data \
  --body '{"name":"test"}' \
  --headers "Content-Type: application/json"

# Check timing
httping get https://api.example.com --timing

# Expect specific status code
httping post https://api.example.com/data --validate-status 201

Authentication

# Basic auth
httping get https://api.example.com/protected --auth "user:password"

Batch Requests

Create requests.yaml:

- url: https://api.example.com/users
  method: GET
- url: https://api.example.com/users
  method: POST
  body: '{"name":"alice"}'
  headers:
    Content-Type: application/json

Run:

httping batch requests.yaml --output results.json

Regression Testing

# Save baseline
httping get https://api.example.com/users --json > baseline.json

# Later, compare
httping get https://api.example.com/users --json > current.json
httping compare baseline.json --against current.json --threshold 100

Output Formats

  • Text (default): Human-readable with pretty-printed JSON
  • JSON (--json): Machine-readable for CI pipelines

All Commands

Command Description
get Send GET request
post Send POST request
put Send PUT request
delete Send DELETE request
patch Send PATCH request
head Send HEAD request
options Send OPTIONS request
request Send request with custom method
batch Run multiple requests from file
compare Compare response against baseline

Options

Option Description
--headers Comma-separated request headers
--body Request body string
--auth Basic auth as user:pass
--timeout Request timeout in seconds (default: 30)
--timing Show detailed timing breakdown
--verbose / -v Show request and response headers
--json / -j Output JSON instead of text
--no-ssl-verify Disable SSL certificate verification
--output / -o Write output to file
--validate-status Expected HTTP status code