on master help sign in
Merge pull request #1024 from messis/add-PutCreated-verb

Add put created verb

commit46973b7ccfe090d7f0097968b9a9e2fc8446d3d2 authorOleg Grenrus <oleg.grenrus@iki.fi> dateThu 16 Aug 2018, 20:13 (8 years ago) parentf75bbf29df6b1f
2 files changed+5−2
servant/src/Servant/API.hs+1−1 servant/src/Servant/API/Verbs.hs+4−1
servant/src/Servant/API.hs+1−1
@@ -130,7 +130,7 @@ import Servant.API.Verbs
130130 Patch, PatchAccepted, PatchNoContent, PatchNonAuthoritative,
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