next up previous contents index
Next: The FastCap Post-Processor: fcpp Up: The XicTools Accessories Previous: Mozy Configuration   Contents   Index

File Transfer Utility: httpget

The httpget program is a stand-alone utility for copying files from a remote system using the HTTP or FTP protocols. This is similar to the httpget program supplied with the XmHTML widget by Ripley Software Development with a few additions:

  1. Support for FTP file retrieval.
  2. Optional graphical window for status reporting.
  3. Support for POST queries.
  4. Support for HTTP basic authentication.
  5. Support for transaction logging.
  6. Conversion to C++ and (hopefully) useful classes.

The workings have been packaged into a library, libhttpget, which can be incorporated into other programs to provide in-process support for httpget-type functionality.

The httpget program is a command-line utility for retrieving files and posting queries to a remote HTTP or FTP server. It can be used, for example, from within a shell script to automate a software update. The program is invoked with

httpget [options] url

where the options are listed below, and the url is a standard-syntax universal resource locator, i.e., a web address of a file, in a form like


The url should contain the http:// or ftp:// prefix to indicate HTTP or FTP protocol, respectively. If no protocol is given, HTTP is assumed. The options are:

-c file
Name of a cookie file. If not given no cookies are sent. Cookies will be stored in and dispatched from this file, during the transaction, if given.

Enable HTTP debug mode, by enabling printing of extra status messages during the transaction.

Don't reissue the request for HTTP location change error. Normal behavior if a 302 (location changed) response is received is to reissue the request to the new location. This option prevents this.

-fp | -fh
Output format for errors: plain or HTML. Error messages are in plain text by default, but can be HTML formatted if -fh is given.

Use a graphical window. If the graphics support has been included in the build, this option pops up a window which provides status indication and a Cancel button. Optionally colon-separated x/y root window coordinates can immediately follow, in which case the upper-left corner of the pop-up will be at that location, if allowed by the window manager.

Show help. The program lists these options and exits.

Only get HTTP document info (HEAD). The normal behavior is to retrieve the entire document. This option obtains document parameters only.

-l file
Log bytes sent and received in file. The log file will contain a listing of the data transmitted and received.

Don't print download status indication. Normal behavior is to print the number of bytes received. This option suppresses this.

-p proxy_url
If given, the proxy will relay all transactions. The proxy_url must begin with an http: protocol specifier (https is not supported), and should have the port number appended following a colon, unless the default port 80 is used.

-o file
Name of destination file on the local machine. If not given the standard output is used for HTTP and the host file name is used for FTP.

-q file
Query file for POST. The file is uploaded to the server.

The following two options set the time to wait for transmission. If contact is not achieved in the timeout interval, httpget will try again, up to the retry count.

-r num
Retry count, default is 0.

-t num
Timeout in seconds, default is 5.

Save HTTP error to output on failure. The normal behavior is to emit errors to the standard error channel. With this option, errors are directed to the output channel (to the file if the -o option is given).

Use HTTP error code as program exit value.

next up previous contents index
Next: The FastCap Post-Processor: fcpp Up: The XicTools Accessories Previous: Mozy Configuration   Contents   Index
Stephen R. Whiteley 2017-03-22