[manual index][section index]

NAME

hget - http client

SYNOPSIS

hget [ -cdfpqv ] [ -m method ] [ -P body ] [ -H version ] [ -h header value ] [ -o file ] [ -x proxyaddr ] url

DESCRIPTION

Hget is a simple http client that requests an url and writes the resulting data to the standard output. This client supports quite a few of the features of the associated library, including: ssl, compression negotiation, connecting through a proxy, issuing ``partial requests'' (for continuing a download). It uses the library in a straightforward manner, making it useful example code for using the library.

The options:


-c
Continue downloading current file (by issuing a ``partial request''). Option -o required too.
-d
Print debugging info.
-f
Request fresh copy by setting the ``cache-control'' header in the request.
-p
Send a body with request, and read the data to post from standard input. Only valid for the http method ``post'', so -m is required too.
-q
Be quiet. Otherwise (the default), progress and some useful special case diagnostics are printed. Progress is represented by twenty dots if the file length is known, otherwise with one dot for every n seconds during which progress was made.
-v
Be verbose. Incompatible with -q.
-m method
Use method as the request. Method is case-insensitive and should be one of: ``get'' (the default), ``post'', ``head'' or ``trace''.
-P body
Like -p but use body as body instead of reading from standard input.
-H version
Use version as http version in the request. Must be one of ``1.0'' or ``1.1''.
-h header value
Add the given header and value to the http request. Note that this may cause an unexpected response that the http library is not prepared for to handled.
-o file
Do not write the body of the response to standard output (the default), but write to file instead. If file does not exist, it is created. Otherwise it is truncated, unless -c was specified.
-x proxyaddr
Use the proxy at proxyaddr (a dial string, not an url) for issuing the request.

SOURCE

/appl/cmd/hget.b
/appl/lib/mhttp.b

BUGS

This is work in progress, see the README for a list of bugs & todo's.

HGET(1 ) Rev:  Wed Feb 22 04:14:06 GMT 2023