on master help sign in
Add PutCreated verb
commit13b521eb9004319b0e74b7b2c2a16a0017cf300b authormessis <karsten@mevassvik.com> dateMon 13 Aug 2018, 15:15 (8 years ago) parentf75bbf2
2 files changed+6−3
servant/src/Servant/API.hs+2−2 servant/src/Servant/API/Verbs.hs+4−1
servant/src/Servant/API.hs+2−2
@@ -127,10 +127,10 @@ import Servant.API.Verbs
127127 (Delete, DeleteAccepted, DeleteNoContent,
128128 DeleteNonAuthoritative, Get, GetAccepted, GetNoContent,
129129 GetNonAuthoritative, GetPartialContent, GetResetContent,
130− Patch, PatchAccepted, PatchNoContent, PatchNonAuthoritative,
130+ Patch, PatchAccepted, PatchNoContent, PatchNonAuthoritative,C
131131 Post, PostAccepted, PostCreated, PostNoContent,
132132 PostNonAuthoritative, PostResetContent, Put, PutAccepted,
133− PutNoContent, PutNonAuthoritative,
133+ PutCreated, PutNoContent, PutNonAuthoritative,
134134 ReflectMethod (reflectMethod), StdMethod (..), Verb)
135135import Servant.API.WithNamedContext
136136 (WithNamedContext)
servant/src/Servant/API/Verbs.hs+4−1
@@ -56,14 +56,17 @@ type Patch = Verb 'PATCH 200
5656-- Indicates that a new resource has been created. The URI corresponding to the
5757-- resource should be given in the @Location@ header field.
5858--
59+-- If the operation is idempotent, use 'PutCreated'. If not, use 'PostCreated'
60+--
5961-- If the resource cannot be created immediately, use 'PostAccepted'.
6062--
6163-- Consider using 'Servant.Links.safeLink' for the @Location@ header
6264-- field.
6365
6466-- | 'POST' with 201 status code.
65−--
6667type PostCreated = Verb 'POST 201
68+-- | 'PUT' with 201 status code.
69+type PutCreated = Verb 'PUT 201
6770
6871
6972-- ** 202 Accepted