git.iko.soy/typeable/servant
on master help sign in
Merge pull request #1024 from messis/add-PutCreated-verb
46973b7Oleg Grenrus
servant/src/Servant/API.hs+1−1
@@ -130,7 +130,7 @@ import Servant.API.Verbs
130 Patch, PatchAccepted, PatchNoContent, PatchNonAuthoritative,
130 Patch, PatchAccepted, PatchNoContent, PatchNonAuthoritative,
131 Post, PostAccepted, PostCreated, PostNoContent,
131 Post, PostAccepted, PostCreated, PostNoContent,
132 PostNonAuthoritative, PostResetContent, Put, PutAccepted,
132 PostNonAuthoritative, PostResetContent, Put, PutAccepted,
133− PutNoContent, PutNonAuthoritative,
133+ PutCreated, PutNoContent, PutNonAuthoritative,
134 ReflectMethod (reflectMethod), StdMethod (..), Verb)
134 ReflectMethod (reflectMethod), StdMethod (..), Verb)
135import Servant.API.WithNamedContext
135import Servant.API.WithNamedContext
136 (WithNamedContext)
136 (WithNamedContext)
servant/src/Servant/API/Verbs.hs+4−1
@@ -56,14 +56,17 @@ type Patch = Verb 'PATCH 200
56-- Indicates that a new resource has been created. The URI corresponding to the
56-- Indicates that a new resource has been created. The URI corresponding to the
57-- resource should be given in the @Location@ header field.
57-- resource should be given in the @Location@ header field.
58--
58--
59+-- If the operation is idempotent, use 'PutCreated'. If not, use 'PostCreated'
60+--
59-- If the resource cannot be created immediately, use 'PostAccepted'.
61-- If the resource cannot be created immediately, use 'PostAccepted'.
60--
62--
61-- Consider using 'Servant.Links.safeLink' for the @Location@ header
63-- Consider using 'Servant.Links.safeLink' for the @Location@ header
62-- field.
64-- field.
63
65
64-- | 'POST' with 201 status code.
66-- | 'POST' with 201 status code.
65−--
66type PostCreated = Verb 'POST 201
67type PostCreated = Verb 'POST 201
68+-- | 'PUT' with 201 status code.
69+type PutCreated = Verb 'PUT 201
67
70
68
71
69-- ** 202 Accepted
72-- ** 202 Accepted