Information on the request sent by the client. This abstracts away the details of the underlying implementation.
Constructors
RequestrequestMethod :: MethodRequest method such as GET.
httpVersion :: HttpVersionHTTP version such as 1.1.
rawPathInfo :: ByteStringExtra path information sent by the client. The meaning varies slightly depending on backend; in a standalone server setting, this is most likely all information after the domain name. In a CGI application, this would be the information following the path to the CGI executable itself.
Middlewares and routing tools should not modify this raw value, as it may be used for such things as creating redirect destinations by applications. Instead, if you are writing a middleware or routing framework, modify the
pathInfoinstead. This is the approach taken by systems like Yesod subsites.Note: At the time of writing this documentation, there is at least one system (
Network.Wai.UrlMapfromwai-extra) that does not follow the above recommendation. Therefore, it is recommended that you test the behavior of your application when usingrawPathInfoand any form of library that might modify theRequest.rawQueryString :: ByteStringIf no query string was specified, this should be empty. This value will include the leading question mark. Do not modify this raw value - modify queryString instead.
requestHeaders :: RequestHeadersA list of headers (a pair of key and value) in an HTTP request.
isSecure :: BoolWas this request made over an SSL connection?
Note that this value will not tell you if the client originally made this request over SSL, but rather whether the current connection is SSL. The distinction lies with reverse proxies. In many cases, the client will connect to a load balancer over SSL, but connect to the WAI handler without SSL. In such a case, isSecure will be False, but from a user perspective, there is a secure connection.
remoteHost :: SockAddrThe client's host information.
pathInfo :: [Text]Path info in individual pieces - the URL without a hostname/port and without a query string, split on forward slashes.
queryString :: QueryParsed query string information.
requestBody :: IO ByteStringGet the next chunk of the body. Returns empty when the body is fully consumed. Since 3.2.2, this is deprecated in favor of getRequestBodyChunk.
vault :: VaultA location for arbitrary data to be shared by applications and middleware.
requestBodyLength :: RequestBodyLengthThe size of the request body. In the case of a chunked request body, this may be unknown.
requestHeaderHost :: Maybe ByteStringThe value of the Host header in a HTTP request.
requestHeaderRange :: Maybe ByteStringThe value of the Range header in a HTTP request.
requestHeaderReferer :: Maybe ByteStringThe value of the Referer header in a HTTP request.
requestHeaderUserAgent :: Maybe ByteStringThe value of the User-Agent header in a HTTP request.