|http:process-uri-request uri &key method headers body client external-format content-type accept-gzip-encoding-p certificate key verify-mode verify-depth ciphers ssl-options ssl-context proxy-host proxy-port follow-redirects errorp retries retry-interval||[Function]|
Process a http based URI request, returning a http response object and the final URI. If links are followed then the final URI may differ from the requested uri.
The method is the http request method, and may be a string or a keyword. The default is the http "GET" method.
The headers is an alist of http headers to send with the request. Some of the arguments noted below setup the headers for most common cases.
A body may be sent with the request, as is typically necessary when sending a http POST method request. The body should be either a (unsigned-byte 8) vector, or a string. A string will be converted into bytes before sending the request, using the content-type character set otherwise trying the :iso-8859-1 or :utf-8 character sets.
The request will use connections managed by the given client which defaults to the http:*default-client*, see http:make-client. The client provides default values for many of the arguments, such as the proxy and the SSL parameters.
The external-format is used to setup a Accept-Charset header which requests that the response use this encoding although the server may choose to return a response using a different encoding.
The content-type is used to setup a Content-Type header. A content-type is typically necessary when a http body is sent with the request. If the body is a string then the content type will default to text/plain.
The client can accept and decode gzip encoded responses. When the client accept-gzip-encoding-p flag is true, an Accept-Encoding header is sent to indicate to the server that it may gzip encode the response body. If this argument is not supplied then the client default is used.
For a https URI the arguments certificate, key, verify-mode, verify-depth, ciphers, and ssl-options are used when opening the SSL connection. For more information see ssl:make-ssl-client-stream. If these arguments are supplied they override the default values for the client.
The client may use a http proxy. The default proxy parameters are obtained from the client object, see http:make-client, but may be overridden by the arguments proxy-host, and proxy-port when supplied.
If follow-redirects is true then responses redirecting to other locations will be followed, otherwise the redirect response is returned.
The request may be automatically retried upon a connection error, or upon a redirection response. The maximum number of retries is controlled by the retries argument. If a response code indicating an error is received the then it is returned immediately when errorp is false otherwise an error is signaled.
For alternate request preparation or response handling the more primitive function http:process-client-request may be appropriate.