http-put

How to submit RESTful partial updates?

Sam Ruby, author of "RESTful Web Services" seems to come out against the use of HTTP PUT for partial updates: http://intertwingly.net/blog/2008/02/15/Embrace-Extend-then-Innovate What isn't clear is how partial updates should take place. As I commented near the bottom of his blog, it isn't clear how using HTTP PATCH is any better than u...

Sending a file via HTTP PUT in PHP

I've been struggling for several hours trying to figure out how to get this work. I'm trying to send a file via HTTP-PUT to an eXist db. There is user authentication for the server, so I was trying to do something like this: I have the URL where the doc is to be PUTted to I have the username and password for the eXist DB I have the co...

Java: HTTP PUT with HttpURLConnection

How do you do do an HTTP PUT? The class I'm using seems to think it is doing a PUT but the endpoint is treating it as if I did a GET. Am I doing anything wrong? URL url = new URL("https://..."); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setDoOutput(true); conn.setRequestMethod("PUT"); OutputStreamWriter wr...

Should I allow sending complete structures when using PUT for updates in a REST API or not?

I am designing a REST API and I wonder what the recommended way to handle updates to resources would be. More specifically, I would allow updates through a PUT on the resource, but what should I allow in the body of the PUT request? Always the complete structure of the resource? Always the subpart (that changed) of the structure of the...

PHP upload file using PUT instead of POST

I read something about this on PHP docs, but it's not clear to me: Do the most widely used browsers (IE, FF, Chrome, Safari, Opera, ...) support this PUT method to upload files? What HTML should I write to make the browser call the server via a PUT request? I mean do I need to write a FORM with an INPUT file field and just replace the ...

Request.Form not populated when using the HTTP PUT method (ASP.NET MVC)

I'm attempting to process the body of an HTTP PUT request, but it seems that the MVC engine (or perhaps the ASP.NET stack underpinning it) isn't automatically parsing & populating the request's Form collection with the body data. This does work as expected when doing a POST. Note that the request's InputStream property does contain the...

How can a PHP REST API receive PUTted data?

I'm writing an API and want to follow the REST approach. As I understand it, if I want to let API users update specific records a PUT http://server/specific_resource type request should be supported. Of course, they're not doing a GET and they'll need to pass along the new data and my question is how to do this (in my specific case only ...