Request composition
Combines a supported HTTP method, absolute URL, bounded query parameters, headers and optional JSON body into one reviewable result.
Day 031 / APIs / Request Composition
A dependency-free Python CLI that validates a bounded HTTP request specification and creates redacted text, JSON and shell-safe cURL previews without sending network traffic.
Combines a supported HTTP method, absolute URL, bounded query parameters, headers and optional JSON body into one reviewable result.
Replaces authorization, cookie, token, secret and API-key header values before they reach text, JSON or cURL output.
Makes no network connection and leaves command execution as a separate, deliberate action for authorized endpoints.
Offline request composition
Deterministic query encoding
Sensitive-header redaction
Shell-safe cURL preview
Bounded defensive validation
Twelve passing standard-library tests
Argparse, pathlib, urllib.parse, JSON and shlex provide the complete dependency-free command-line workflow.
Applies URL validation, deterministic query encoding, header safeguards and JSON body limits without depending on a remote service.
Twelve tests cover URL boundaries, query composition, sensitive values, header injection, body rules, immutability and CLI output.