owncloud/core — pull request #5038 by tanghus (2013-09-30 14:32:35+00:00)
Title: Enhance Request

* Add patch method to OC_Route
* Exception when e.g. accessing $request->get if the current HTTP method is POST. Makes it a helluva lot easier to find errors in your cut'n'paste code ;)
* Add patch method to OC_Route
* Add PATCH and PUT accessors to Request. PATCH returns an array like GET and POST. PUT returns a once-only stream respource.
* Moved POST json parsing to Request.
* Document accessors in IRequest.
* And unit tests :smile_cat:

I though a lot about what to do with the `php://input` that can only be read once, and I think this is the best approach. PATCH requests are per definition not big - otherwise you're Doing It Wrong - and if properly documented a stream resource for PUT makes most sense. I though about making it conditional either by an argument or by the size of the request body, but it would just be too obfuscated what you would actually get.

@DeepDiver1975 @Raydiation @bartv2