Usage of optional Header (Maybe Header and etc)

37 views
Skip to first unread message

ruslan yurov

unread,
Oct 20, 2016, 10:35:29 AM10/20/16
to haskell-servant
Hi all)

I'm using Servant (very good library :-) ) and it is interesting for me to know is there any way to have header optional?
type GetNames = "names" :> Get '[JSON] (Maybe(Headers '[Header "smth" String]) [Name]) or
type GetNames = "names" :> Get '[JSON] (Headers '[Maybe(Header "smth" String)] [Name])

Nigel Rantor

unread,
Jan 1, 2017, 4:38:30 PM1/1/17
to haskell-servant
I hit the same problem and since then there has been the addition of noHeader, see below;

https://hackage.haskell.org/package/servant-0.9.1.1/docs/Servant-API-ResponseHeaders.html#v:noHeader

You may need to upgrade to get it.

  n
Reply all
Reply to author
Forward
0 new messages