From 03fe5ca355e63201924d841cb9c852be4eadf9d2 Mon Sep 17 00:00:00 2001 From: Jordan Bancino Date: Wed, 1 Nov 2023 08:33:37 -0400 Subject: [PATCH] Move http man page to Cytoplasm from Telodendria. --- man/man1/http.1 | 70 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 man/man1/http.1 diff --git a/man/man1/http.1 b/man/man1/http.1 new file mode 100644 index 0000000..3a108e9 --- /dev/null +++ b/man/man1/http.1 @@ -0,0 +1,70 @@ +.Dd $Mdocdate: March 12 2023 $ +.Dt HTTP 1 +.Os Telodendria Project +.Sh NAME +.Nm http +.Nd A simple command line utility for making HTTP requests. +.Sh SYNOPSIS +.Nm +.Op Fl i +.Op Fl X Ar method +.Op Fl H Ar header +.Op Fl d Ar data +.Op URL +.Sh DESCRIPTION +.Nm +Is a command line HTTP client. It is very heavily inspired by +.Xr curl 1 , +and even uses the same flag names when possible. However, +.Nm +is designed to be much simpler than +.Xr curl 1 , +and is built on Telodendria's own +.Xr HttpClient 3 +API. It primarily exists to test +.Xr HttpClient 3 +and +.Xr HttpServer 3 , +and make development of Telodendria possible without having +to install any external tools. +.sp +The options are as follows: +.Bl -tag -width Ds +.It Fl i +Display the response headers before writing the body. +.It Fl X Ar method +Set the request method. This can be any of the options +allowed by the +.Xr Http 3 +API; unlike +.Xr curl 1 , +it cannot be any arbitrary string. +.It Fl H Ar header +Set a request header, in the form of ``Header: value''. This option +can be set multiple times to add multiple request headers. +.It Fl d Ar data +Send data to the server in the request body. If +.Ar 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. +.El +.Pp +.Nm +also requires a +.Ar URL +to make the request to. The URL is parsed by the +.Xr Uri 3 +API, so consult that page for the syntax of URLs. +.Sh EXIT STATUS +.Nm +exits with +.Va 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 +.Va EXIT_FAILURE +in all other scenarios. +.Sh SEE ALSO +.Xr HttpClient 3 , +.Xr Uri 3