Overview
Thehttpc command-line tool is a curl-like HTTP client that operates over the reliable UDP protocol. It supports GET and POST requests with headers, inline data, file uploads, and verbose output.
General Usage
All requests are sent through the reliable UDP protocol implementation, providing TCP-like reliability over UDP.
Commands
help
Displays usage information.GET Command
Executes an HTTP GET request for a given URL.Syntax
Parameters
Verbose mode. Prints the detailed response including protocol, status, and headers.
Associates headers to the HTTP request with the format
key:value. Can be used multiple times.The target URL for the GET request. Must include protocol, host, and path.
Examples
Response Format
- Normal Mode
- Verbose Mode (-v)
Shows only the response body:
Help Text
POST Command
Executes an HTTP POST request for a given URL with inline data or file content.Syntax
Parameters
Verbose mode. Prints the detailed response including protocol, status, and headers.
Associates headers to the HTTP request with the format
key:value. Can be used multiple times.Associates inline data to the body of the HTTP POST request.
Associates the content of a file to the body of the HTTP POST request.
Writes the response output to the specified file instead of stdout.
The target URL for the POST request.
Examples
Request Format
The POST command automatically constructs a proper HTTP request:Help Text
Common Flags
-v (Verbose)
-v (Verbose)
Purpose: Display full response detailsBehavior:Output:
- Shows HTTP version and status code
- Displays all response headers
- Shows response body
-h (Headers)
-h (Headers)
Purpose: Add custom HTTP headers to the requestFormat:
-h key:valueUsage:- Can be specified multiple times
- No spaces around the colon
- Common headers:
Content-Type,Authorization,Accept,User-Agent
-d (Inline Data)
-d (Inline Data)
Purpose: Send inline data in POST request bodyPOST only: This flag is only valid for POST requestsUsage:
- Mutually exclusive with
-f - Automatically sets
Content-Lengthheader - String data is sent as-is
-f (File Data)
-f (File Data)
Purpose: Send file contents in POST request bodyPOST only: This flag is only valid for POST requestsUsage:
- Mutually exclusive with
-d - Reads entire file into request body
- File path is relative to current directory
-o (Output File)
-o (Output File)
Purpose: Write response to a file instead of stdoutUsage:
- Works with both GET and POST
- Creates or overwrites the specified file
- File path is relative to current directory
URL Format
URLs must follow this format:Must be
http://Hostname or IP address
Port number (no default)
Request path (defaults to
/)URL Examples
HTTP Protocol
The client uses a custom HTTP/1.0-like protocol:The protocol identifier is
HTTPFC/1.0 instead of standard HTTP/1.0Request Format
Connection Process
Response reception
The client receives response packets, sends ACKs/NACKs, and assembles the complete response.
Error Messages
Malformed URL
Malformed URL
http://host:port/pathWrong command
Wrong command
httpcSolution: Start command with httpc followed by get, post, or helpConnection Error
Connection Error
Exceptions during socket operationsPossible causes:
- Server not reachable
- Network timeout
- Port unavailable
Integration Example
Using the httpc client programmatically:See Also
ReliableClientProtocol
Underlying reliable UDP protocol
Packet Format
Packet structure used for transmission