1 | <?php |
||
20 | class HttpRequest extends Request |
||
21 | { |
||
22 | /** |
||
23 | * List of supported input formats. |
||
24 | * @var array |
||
25 | */ |
||
26 | protected $formats = array('post', 'json', 'xml'); |
||
27 | |||
28 | /** |
||
29 | * Returns the format from an HTTP context. |
||
30 | * |
||
31 | * @param string $context The context to extract the format from. |
||
32 | * @return string The extracted format. |
||
33 | */ |
||
34 | public static function getFormat($context) |
||
54 | |||
55 | /** |
||
56 | * Returns the format from an HTTP Accept. |
||
57 | * |
||
58 | * @return string The output format |
||
59 | */ |
||
60 | public function getAcceptFormat() |
||
73 | |||
74 | /** |
||
75 | * Get & parse the request body-data. |
||
76 | * |
||
77 | * @param boolean $assoc Wether to convert objects to associative arrays or not. |
||
78 | * @return array |
||
79 | * @link http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4 |
||
80 | * @link http://www.w3.org/TR/html401/references.html#ref-RFC2388 |
||
81 | */ |
||
82 | public function getBodyData($assoc=true) |
||
108 | |||
109 | /** |
||
110 | * Sets the input formats. |
||
111 | * |
||
112 | * @return void |
||
113 | */ |
||
114 | public function setFormats(array $formats) |
||
118 | |||
119 | } |
||
120 |