]> source.dussan.org Git - nextcloud-server.git/commitdiff
Add interface docs to IRequest.
authorThomas Tanghus <thomas@tanghus.net>
Fri, 27 Sep 2013 13:55:22 +0000 (15:55 +0200)
committerThomas Tanghus <thomas@tanghus.net>
Fri, 27 Sep 2013 13:55:22 +0000 (15:55 +0200)
lib/public/irequest.php

index 9f335b06f2ac85093f6ff92f6749d8dbd48d2129..5611180473d443c8598d7a50aa9819dc30f95b34 100644 (file)
 
 namespace OCP;
 
+/**
+ * This interface provides an immutable object with with accessors to
+ * request variables and headers.
+ *
+ * Access request variables by method and name.
+ *
+ * Examples:
+ *
+ * $request->post['myvar']; // Only look for POST variables
+ * $request->myvar; or $request->{'myvar'}; or $request->{$myvar}
+ * Looks in the combined GET, POST and urlParams array.
+ *
+ * If you access e.g. ->post but the current HTTP request method
+ * is GET a \LogicException will be thrown.
+ *
+ * NOTE:
+ * - When accessing ->put a stream resource is returned and the accessor
+ *   will return false on subsequent access to ->put or ->patch.
+ * - When accessing ->patch and the Content-Type is either application/json
+ *   or application/x-www-form-urlencoded (most cases) it will act like ->get
+ *   and ->post and return an array. Otherwise the raw data will be returned.
+ */
 
 interface IRequest {