Day 031 / APIs / Request Composition

API Request Builder

View source ↗Scroll to explore ↓
API Request Builder project cover
/ Overview

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.

NameAPI Request Builder

ClientIndependent daily build

IndustriesDeveloper tooling

DateDay 031 · September 30, 2026

/ Challenge

Composing an API request by hand can hide malformed URLs, ambiguous query encoding, unsafe header line breaks or accidentally exposed credentials. Running a command immediately also skips the chance to review exactly what was assembled.

/ Provided services

Clear thinking.
Practical delivery.

01

Request composition

Combines a supported HTTP method, absolute URL, bounded query parameters, headers and optional JSON body into one reviewable result.

02

Privacy-aware preview

Replaces authorization, cookie, token, secret and API-key header values before they reach text, JSON or cURL output.

03

Explicit execution boundary

Makes no network connection and leaves command execution as a separate, deliberate action for authorized endpoints.

API Request Builder feature visual
/ Solution

API Request Builder validates a compact JSON specification, composes its HTTP method, URL, query parameters, headers and optional JSON body, then produces deterministic text, JSON and shell-safe cURL previews. It always redacts sensitive header values and never sends the request.

/ Impact

Offline request composition

Deterministic query encoding

Sensitive-header redaction

Shell-safe cURL preview

Bounded defensive validation

Twelve passing standard-library tests

/ Tech stack

Python standard library

Argparse, pathlib, urllib.parse, JSON and shlex provide the complete dependency-free command-line workflow.

API data handling

Applies URL validation, deterministic query encoding, header safeguards and JSON body limits without depending on a remote service.

Unittest

Twelve tests cover URL boundaries, query composition, sensitive values, header injection, body rules, immutability and CLI output.

Next project

Patch Log Formatter

View case study ↗