haskell-servant/servant

Idea Symbolic Names for HTTP Status codes

Open

#628 ouverte le 27 oct. 2016

Voir sur GitHub
 (9 commentaires) (1 réaction) (0 assignés)Haskell (422 forks)batch import
enhancementhelp wantedservant-api

Métriques du dépôt

Stars
 (1 953 stars)
Métriques de merge PR
 (Merge moyen 5h 49m) (2 PRs mergées en 30 j)

Description

I had a thought, currently to express a http status code you have to remember the number, would it be possible to have a named type for them. So instead of having the number 304 in my code I could ahve the value 'NotModified' which esp for some of the more unusual status codes would be very helpful in making code more readable.

For example if I see that something should return 415 I probably will have to look up what that means but if I see UnsupportedMediaType it is self documenting.

Guide contributeur