Reputation: 25
I know from the documentation that I can do something like the following to capture a specific header:
type MyApi = "view-my-referer" :> Header "from" Referer :> Get '[JSON] Referer
But I'm exploring some webhooks that aren't well documented, and I'd like to just inspect all the headers in the request.
Upvotes: 1
Views: 433
Reputation: 3071
I use Network.Wai.Middleware.RequestLogger to log headers for all incoming requests, regardless of which Servant endpoint ends up handling the request. I've used this to understand under-documented APIs, and for other sorts of debugging.
Upvotes: 4