and if you want to be able to return more than one success status code for a given endpoint you can either hack it using throwErr, or more appropriately, you can use the new UVerb machinery (disclaimer: I haven't tried it out)
It does raise one question though. When thinking about it I mentally connect the verb with the request and the status with the response. I'm probably influenced by the various HTTP libraries I've used across multiple languages. AFAICS there's no obvious relationship between verb and status in the protocol at all.
So what's the reason for connecting the verb and the status in this way? Is there a philosophical/logical reasoning behind it?
I feel a little silly about asking this, but how do I get servant to create success responses with status other than 200?
you can specify it by directly using the
Verb
typeinstead of the synonyms for it, which are more commonly used, such as
GET
https://hackage.haskell.org/package/servant-0.18.2/docs/Servant-API-Verbs.html#t:Verb
this thing
and if you want to be able to return more than one success status code for a given endpoint you can either hack it using
throwErr
, or more appropriately, you can use the newUVerb
machinery (disclaimer: I haven't tried it out)Thanks, that was the information I never saw mentioned in any tutorial or example I've found!
It does raise one question though. When thinking about it I mentally connect the verb with the request and the status with the response. I'm probably influenced by the various HTTP libraries I've used across multiple languages. AFAICS there's no obvious relationship between verb and status in the protocol at all.
So what's the reason for connecting the verb and the status in this way? Is there a philosophical/logical reasoning behind it?