@@ -22,8 +22,10 @@ import Network.Socket (SockAddr)
2222
2323-- | Information on the request sent by the client. This abstracts away the
2424-- details of the underlying implementation.
25−data Request = Request
26− { requestMethod :: H.Method
25+data Request = Request {
26+ -- | Request method such as GET.
27+ requestMethod :: H.Method
28+ -- | HTTP version such as 1.1.
2729 , httpVersion :: H.HttpVersion
2830 -- | Extra path information sent by the client. The meaning varies slightly
2931 -- depending on backend; in a standalone server setting, this is most likely
@@ -35,6 +37,7 @@ data Request = Request
3537 -- /will/ include the leading question mark.
3638 -- Do not modify this raw value- modify queryString instead.
3739 , rawQueryString :: B.ByteString
40+ -- | A list of header (a pair of key and value) in an HTTP request.
3841 , requestHeaders :: H.RequestHeaders
3942 -- | Was this request made over an SSL connection?
4043 --
@@ -51,6 +54,7 @@ data Request = Request
5154 , pathInfo :: [Text]
5255 -- | Parsed query string information
5356 , queryString :: H.Query
57+ -- | A request body provided as 'Source'.
5458 , requestBody :: C.Source IO B.ByteString
5559 -- | A location for arbitrary data to be shared by applications and middleware.
5660 , vault :: Vault
@@ -59,8 +63,12 @@ data Request = Request
5963 -- Since 1.4.0
6064 , requestBodyLength :: RequestBodyLength
6165 -- | The value of the Host header in a HTTP request.
66+ --
67+ -- Since 2.0.0
6268 , requestHeaderHost :: Maybe B.ByteString
6369 -- | The value of the Range header in a HTTP request.
70+ --
71+ -- Since 2.0.0
6472 , requestHeaderRange :: Maybe B.ByteString
6573 }
6674 deriving (Typeable)
@@ -81,6 +89,7 @@ data Response
8189 | ResponseSource H.Status H.ResponseHeaders (forall b. WithSource IO (C.Flush Builder) b)
8290 deriving Typeable
8391
92+-- | Auxiliary type for 'ResponseSource'.
8493type WithSource m a b = (C.Source m a -> m b) -> m b
8594
8695-- | The size of the request body. In the case of chunked bodies, the size will