4 ms·
I'm pretty sure I got it right. The HTTP 1.1 RFC says: > The PUT method requests that the enclosed entity be stored under the supplied Request-URI. http://ww
by mleonhard 16y ago
I'm pretty sure I got it right. The HTTP 1.1 RFC says:
> The PUT method requests that the enclosed entity be stored under the supplied Request-URI.
http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.6 http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.6
I interpret this to mean that if you PUT to /some/file then you should be able to GET /some/file and get back the same thing. RestBackup access urls provide this behavior.
- blasdel 16y agoSorry, you're right about using PUT to create a resource at the supplied URL -- but you're still breaking the expectation of idempotence: repeating the same request should have the same result, not 201 the first time and 405 thereafter. If you really want those semantics use POST. If you're really set on using PUT, you could change your semantics a bit so that PUTting the original file again results in 200 OK but attempts replace it with a different file return 409 Conflict or something.