HTTP(1) General Commands Manual HTTP(1)

httpA simple command line utility for making HTTP requests.

http [-i] [-X method] [-H header] [-d data] [URL]

http Is a command line HTTP client. It is very heavily inspired by curl(1), and even uses the same flag names when possible. However, http is designed to be much simpler than curl(1), and is built on Telodendria's own HttpClient(3) API. It primarily exists to test HttpClient(3) and HttpServer(3), and make development of Telodendria possible without having to install any external tools.

The options are as follows:

Display the response headers before writing the body.
Set the request method. This can be any of the options allowed by the Http(3) API; unlike curl(1), it cannot be any arbitrary string.
Set a request header, in the form of ``Header: value''. This option can be set multiple times to add multiple request headers.
Send data to the server in the request body. If data starts with ``@'', then the file specified after is opened and read in. If it is ``@-'', then standard input is used. Otherwise, the string is passed to the server as-is.

http also requires a URL to make the request to. The URL is parsed by the Uri(3) API, so consult that page for the syntax of URLs.

http exits with EXIT_SUCCESS if all command line options were valid, the request was made successfully, and the server returns an HTTP code that indicates success. It exits with EXIT_FAILURE in all other scenarios.

HttpClient(3), Uri(3)

March 12, 2023 Telodendria Project