URL(1) User Commands URL(1) NAME url SYNOPSIS url [options] [METHOD] URL [items,...] DESCRIPTION URL: A simple client HTTP test program url [options] [METHOD] URL [items,...] --benchmark 3 --ca file --cert file --chunk size --ciphers cipher,... --clients count --continue --cookie CookieString --count NUM --debug --header 'key: value' --key file --nofollow --printable --protocol 0|1 --quiet --range byteRanges --retries count --save file --show [HBhb] --timeout secs --trace file[:type:from] --upload --verify --verbose --zero The URL program is a pragmatic, simple, compact HTTP test client. It does not attempt to implement all the HTTP specifications. It supports HTTP/1 keep-alive and transfer-chunking encoding. ARGUMENTS The url command takes an optional METHOD as the first argument. This must be an upper case word. If absent, the POST method is used if there is supplied body data items and otherwise the GET method is used. After the optional method is the required URL. The request URL uses a flexible format so you can supply only the essential URL components. For example. $ url /index.html $ url :8080 $ url / $ url https:///index.html URL The request URL is of the form: [http://|https://][hostname][:port][/path][?query][#hash] All portions of the URL are optional. You can supply just the components that are non-default. If the HTTP scheme is absent, "http" is used. If the hostname is missing, "localhost" is used. If the port is absent, the default HTTP port for the relevant scheme is used. If the path is not supplied, "/" is used. If the query or hash are absent, they are not used. REQUEST ITEMS Requests can supply body data by appending request items to the command line. The following request item formats are supported. key=value Request form parameters. {key:value,..} Request form parameters as a JSON string. @file Request body supplied via a file. "Literal Data" Request body as a literal string. Header:Value HTTP headers If JSON is supplied, only one JSON item can be provided and a Content- Type of application/json will be added to the HTTP request headers. If a Key=Value parse are provided, multiple such values can be use and a Content-Type of x-www-form-urlencoded will be added to the headers. SHOW TRACE By default, url will display the response HTTP headers and response data. This can be modified via the --show command option. Use the --quiet or --show "" to squelch outputting the response HTTP headers. OPTIONS --benchmark Compute benchmark statistics for the requests. --ca file Certifiate authority. This is used to validate peer site certificates. --chunk size Send request body data using transfer chunk encoding of this maximum size. --ciphers cipher,cipher List of TLS cipers to use for the request. --clients count Use the requested number of simulated clients to run simultaneous requests. Default is 1. --continue Continue testing despite request errors. --cookie Cookie string header. --debug Enable debug tracing. (Shortcut -d). --header key:value Include the HTTP header key:value in the requeset. --key file Use the supplied private key when sending client certificates to the server. --nofollow Do not follow redirections. Default is to follow. --printable If the returned content contains binary data, convert to a printable hex format. --protocol 0|1 If set to 0, use the HTTP/1.0 protocol, otherwise use the default HTTP/1.1 --quiet Do not display HTTP response headers. Alias for --show "". --range byteRanges Add to the request the specified byte ranges. --retries count Define the retry limit for the request. This is used to retry requests and to follow redirections. Default is 3. --save filename Save the response content to the given filename. --show [HBhb] Show the request headers/body (HB) and response headers/body (hb). Defaults to --show h. Set to an empty string to disable all tracing. --timeout secs Timeout the request if it does not complete in the required number of seconds. --trace file[:types[:sources]] Name the Ioto trace file. The types are a comma separated list of message types. Valid types include: info, debug, error, and trace. Sources are the code module names originating the trace messages. You can use "all" for types and sources to match all types/sources. You can also use "!type" and "!source" to negate a type or source. --upload POST the supplied data items (or files) using multipart-mime file upload. --verify Verify the server certificate using the certificate authority bundle supplied with the --ca file option. The default is to not verify. --verbose Run with more verbose tracing. (Shortcut -v). --version Output the product version number. REPORTING BUGS Report bugs to dev@embedthis.com. COPYRIGHT Copyright (c) Embedthis Software. url June 2022 URL(1)