3 ms·
> PATCH or PUT edited the files on the server The HTTP spec refers to these "files" as resources, which it sometimes also calls "data". All persistent data on
by smt88 5y ago
> PATCH or PUT edited the files on the server
The HTTP spec refers to these "files" as resources, which it sometimes also calls "data".
All persistent data on a server is a file ultimately, whether it's part of a database or not, so I'm not sure what your point is. Nearly all useful APIs will interact with files.
> If you do that against an api, then the behaviour is to edit the source code of the api (WebDav interpretation)
What? Absolutely not. I have no idea how you made this leap. WebDAV is just a specific HTTP spec that involves content. There is nothing in the HTTP spec that relates to editing source files.
> I see no way of interpreting the spec as saying using POST to send messages to an api endpoint for processung instead of some specific method, is less correct than using a more specific method.
I don't either. That's not at all what I was contending.
Here's what the spec clearly says about the difference between POST and PUT:
> "The fundamental difference between the POST and PUT requests is reflected in the different meaning of the Request-URI. The URI in a POST request identifies the resource that will handle the enclosed entity. That resource might be a data-accepting process, a gateway to some other protocol, or a separate entity that accepts annotations. In contrast, the URI in a PUT request identifies the entity enclosed with the request -- the user agent knows what URI is intended and the server MUST NOT attempt to apply the request to some other resource. If the server desires that the request be applied to a different URI, it MUST send a 301 (Moved Permanently) response; the user agent MAY then make its own decision regarding whether or not to redirect the request."