need some clarity on https://tools.ietf.org/html/rfc7231#page-25

35 views
Skip to first unread message

miqui

unread,
Dec 7, 2018, 10:35:26 AM12/7/18
to API Craft
hi community,

..looking into https://tools.ietf.org/html/rfc7231#page-25, POST the below paragraph...  can someone explain this a bit further? thanks!


 If the result of processing a POST would be equivalent to a
   representation of an existing resource, an origin server MAY redirect
   the user agent to that resource by sending a 303 (See Other) response
   with the existing resource's identifier in the Location field.  This
   has the benefits of providing the user agent a resource identifier
   and transferring the representation via a method more amenable to
   shared caching, though at the cost of an extra request if the user
   agent does not already have the representation cached.


rgds,
Miguel
Message has been deleted

James Higginbotham

unread,
Dec 8, 2018, 10:03:30 AM12/8/18
to API Craft
Hi Miguel,

If I interpret the spec properly, they are offering an option to return a Location containing the url of a request that results in a resource representationand at the same time, redirecting the agent to the url. If a representation is returned immediately after the POST (common with many APIs today), it should not be considered cacheable as it was not fetched with a GET that would return cache control headers, an ETag, and the last modified date. This paragraph describes a way to accomplish both the initial POST request and returning a cacheable representation of the resource, but at the expense of another http request by the agent as it follows the location in the 303 response using a GET.

James

Reply all
Reply to author
Forward
0 new messages