RE: Question about resource and representation

Interesting philosophical question.

In the sense that POST is different from PUT (representation is desired end state) or PATCH (representation is difference between current state and desired state), that’s true.  You can’t necessary look at the request and the result of a GET and predict the end state of the resource after the POST.

But consider that “the resource’s own specific semantics” can be treated as a function that takes some input and produces a desired state.  POST, in effect, says “I know that function, and here’s the input required to create the desired state.”  An observer doesn’t know the function, but that’s irrelevant if the client and server do.  And if they both do, then the input is “a format that can be readily communicated.”

From: Yi, EungJun [mailto:semtlenori@gmail.com]
Sent: Monday, November 14, 2016 2:09 PM
To: ietf-http-wg@w3.org
Subject: Question about resource and representation


Hi,



According to RFC 7231, a representation is a state of a given resource



   For the purposes of HTTP, a "representation" is information that is

   intended to reflect a past, current, or desired state of a given

   resource, in a format that can be readily communicated via the

   protocol, and that consists of a set of representation metadata and a

   potentially unbounded stream of representation data.



and a payload in a POST request is also a representation.



   The POST method requests that the target resource process the

   representation enclosed in the request according to the resource's

   own specific semantics.



Then what is the resource which the representation enclosed in the POST request reflects? I think the representation may not reflect a state of the target resource for the POST request.



Thanks in advance.



Best regards,

EungJun

Received on Monday, 14 November 2016 05:26:31 UTC