| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Log.HttpRequest
Description
A module for creating great logs in code that send or receive HTTP requests.
Synopsis
- data Details
- newtype Incoming = Incoming Details
- newtype Outgoing = Outgoing Details
- emptyDetails :: Details
- method :: Details -> Maybe Text
- host :: Details -> Maybe Text
- path :: Details -> Maybe Text
- queryString :: Details -> Maybe Text
- headers :: Details -> Dict Text Text
- httpVersion :: Details -> Maybe Text
- endpoint :: Details -> Maybe Text
- status :: Details -> Maybe Int
Documentation
A type describing an http request.
emptyDetails { method = Just "GET" , host = Just "https://noredink.com" }Instances
A wrapper around the Details type to indicate that we're reporting an incoming http, like a request sent from a frontend to an http server.
Instances
| ToJSON Incoming Source # | |
Defined in Log.HttpRequest | |
| TracingSpanDetails Incoming Source # | |
Defined in Log.HttpRequest Methods toTracingSpanDetails :: Incoming -> SomeTracingSpanDetails fromTracingSpanDetails :: SomeTracingSpanDetails -> Maybe Incoming | |
A wrapper around the Details type to indicate that this is an outgoing http request, for example a request we're making to an external weather API.
Instances
| ToJSON Outgoing Source # | |
Defined in Log.HttpRequest | |
| TracingSpanDetails Outgoing Source # | |
Defined in Log.HttpRequest Methods toTracingSpanDetails :: Outgoing -> SomeTracingSpanDetails fromTracingSpanDetails :: SomeTracingSpanDetails -> Maybe Outgoing | |
emptyDetails :: Details Source #
An empty details value to be modified by you.
queryString :: Details -> Maybe Text Source #
The query string portion of the request URI.
headers :: Details -> Dict Text Text Source #
The headers on the request. Do not pass headers with sensitive information in there, filter them out first!
httpVersion :: Details -> Maybe Text Source #
The version of the http protocol used.