0 | ||| Define request types and functions
 1 | module Pact.WAI.Request
 2 |
 3 | import Pact.WAI.Core
 4 | import public Data.SortedMap
 5 | import Pact.WAI.Method
 6 | import Pact.WAI.Version
 7 | import Pact.WAI.Header
 8 |
 9 | ||| RequestBody is the type of request body
10 | ||| It is a stream of bytes
11 | public export
12 | 0 RequestBody : Type
13 | RequestBody = HTTPStream ByteString
14 |
15 | ||| HTTP request record type
16 | ||| Contains all relevant information for an HTTP request
17 | public export
18 | record Request where
19 |   constructor MkRequest
20 |   ||| HTTP request method (GET, POST, etc.)
21 |   method  : Method
22 |   ||| Request URI path
23 |   uri     : String
24 |   ||| Query parameter map
25 |   queryParams : QueryParams
26 |   ||| HTTP version
27 |   version : Version
28 |   ||| HTTP header fields map
29 |   headers : Headers
30 |   ||| Request body length
31 |   length  : Nat
32 |   ||| Request body content type
33 |   type    : Maybe String
34 |   ||| Request body byte stream
35 |   body    : RequestBody
36 |
37 |