Modulewai-extra-3.1.16Haskell2010
Network.Wai.Middleware.RequestLogger.JSON
- 3 values
- Packagewai-extra-3.1.16
- Exports3
- LanguageHaskell2010
- LicenceMIT
- SourceJSON.hs
Same as formatAsJSON but with response headers included
This is useful for passing arbitrary data from your application out to the WAI layer for it to be logged, but you may need to be careful to subsequently redact any headers which may contain sensitive data.
requestToJSON :: RequestThe WAI request
-> [ByteString]Chunked request body
-> Maybe NominalDiffTimeOptional request duration
-> Value
Get the JSON representation for a request
This representation is identical to that used in formatAsJSON for the request. It includes:
methodpathqueryStringsizeThe size of the body, as defined in the request. This may differ from the size of the data passed in the second argument.
bodyThe body, concatenated directly from the chunks passed in
remoteHosthttpVersionheaders
If a Just duration is passed in, then additionally the JSON includes:
durationMsThe duration, formatted in milliseconds, to 2 decimal places
This representation is not an API, and may change at any time (within reason) without a major version bump.