1<?php
2
3namespace Sabre\HTTP;
4
5/**
6 * The RequestInterface represents a HTTP request.
7 *
8 * @copyright Copyright (C) fruux GmbH (https://fruux.com/)
9 * @author Evert Pot (http://evertpot.com/)
10 * @license http://sabre.io/license/ Modified BSD License
11 */
12interface RequestInterface extends MessageInterface {
13
14    /**
15     * Returns the current HTTP method
16     *
17     * @return string
18     */
19    function getMethod();
20
21    /**
22     * Sets the HTTP method
23     *
24     * @param string $method
25     * @return void
26     */
27    function setMethod($method);
28
29    /**
30     * Returns the request url.
31     *
32     * @return string
33     */
34    function getUrl();
35
36    /**
37     * Sets the request url.
38     *
39     * @param string $url
40     * @return void
41     */
42    function setUrl($url);
43
44    /**
45     * Returns the absolute url.
46     *
47     * @return string
48     */
49    function getAbsoluteUrl();
50
51    /**
52     * Sets the absolute url.
53     *
54     * @param string $url
55     * @return void
56     */
57    function setAbsoluteUrl($url);
58
59    /**
60     * Returns the current base url.
61     *
62     * @return string
63     */
64    function getBaseUrl();
65
66    /**
67     * Sets a base url.
68     *
69     * This url is used for relative path calculations.
70     *
71     * The base url should default to /
72     *
73     * @param string $url
74     * @return void
75     */
76    function setBaseUrl($url);
77
78    /**
79     * Returns the relative path.
80     *
81     * This is being calculated using the base url. This path will not start
82     * with a slash, so it will always return something like
83     * 'example/path.html'.
84     *
85     * If the full path is equal to the base url, this method will return an
86     * empty string.
87     *
88     * This method will also urldecode the path, and if the url was incoded as
89     * ISO-8859-1, it will convert it to UTF-8.
90     *
91     * If the path is outside of the base url, a LogicException will be thrown.
92     *
93     * @return string
94     */
95    function getPath();
96
97    /**
98     * Returns the list of query parameters.
99     *
100     * This is equivalent to PHP's $_GET superglobal.
101     *
102     * @return array
103     */
104    function getQueryParameters();
105
106    /**
107     * Returns the POST data.
108     *
109     * This is equivalent to PHP's $_POST superglobal.
110     *
111     * @return array
112     */
113    function getPostData();
114
115    /**
116     * Sets the post data.
117     *
118     * This is equivalent to PHP's $_POST superglobal.
119     *
120     * This would not have been needed, if POST data was accessible as
121     * php://input, but unfortunately we need to special case it.
122     *
123     * @param array $postData
124     * @return void
125     */
126    function setPostData(array $postData);
127
128    /**
129     * Returns an item from the _SERVER array.
130     *
131     * If the value does not exist in the array, null is returned.
132     *
133     * @param string $valueName
134     * @return string|null
135     */
136    function getRawServerValue($valueName);
137
138    /**
139     * Sets the _SERVER array.
140     *
141     * @param array $data
142     * @return void
143     */
144    function setRawServerData(array $data);
145
146
147}
148