1+ #############
12Request Class
2- *************
3+ #############
34
45The request class is an object-oriented representation of an HTTP request. This is meant to
56work for both incoming, such as a request to the application from a browser, and outgoing requests,
6- like would be used to send a request from the application to a third-party application. This class
7+ like would be used to send a request from the application to a third-party application.
8+
9+ This class
710provides the common functionality they both need, but both cases have custom classes that extend
8- from the Request class to add specific functionality.
11+ from the Request class to add specific functionality. In practice, you will need to use these classes.
912
1013See the documentation for the :doc: `IncomingRequest Class </incoming/incomingrequest >` and
1114:doc: `CURLRequest Class </libraries/curlrequest >` for more usage details.
1215
1316Class Reference
14- ===============
17+ ***************
1518
1619.. php :namespace :: CodeIgniter\HTTP
1720
@@ -33,6 +36,9 @@ Class Reference
3336
3437 .. php :method :: isValidIP($ip[, $which = ''])
3538
39+ .. deprecated :: 4.0.5
40+ Use :doc: `../libraries/validation ` instead.
41+
3642 .. important :: This method is deprecated. It will be removed in future releases.
3743
3844 :param string $ip: IP address
@@ -65,19 +71,30 @@ Class Reference
6571
6672 .. php :method :: setMethod($method)
6773
68- :param string $upper: Sets the request method. Used when spoofing the request.
69- :returns: HTTP request method
74+ .. deprecated :: 4.0.5
75+ Use :php:meth: `CodeIgniter\\ HTTP\\ Request::withMethod() ` instead.
76+
77+ :param string $method: Sets the request method. Used when spoofing the request.
78+ :returns: This request
79+ :rtype: Request
80+
81+ .. php :method :: withMethod($method)
82+
83+ .. versionadded :: 4.0.5
84+
85+ :param string $method: Sets the request method.
86+ :returns: New request instance
7087 :rtype: Request
7188
7289 .. php :method :: getServer([$index = null[, $filter = null[, $flags = null]]])
7390
7491 :param mixed $index: Value name
75- :param int $filter: The type of filter to apply. A list of filters can be found ` here <https://www.php.net/manual/en/filter.filters.php >`__.
76- :param int|array $flags: Flags to apply. A list of flags can be found ` here <https://www.php.net/manual/en/filter.filters.flags.php >`__.
77- :returns: $_SERVER item value if found, null if not
92+ :param int $filter: The type of filter to apply. A list of filters can be found in ` PHP manual <https://www.php.net/manual/en/filter.filters.php >`__.
93+ :param int|array $flags: Flags to apply. A list of flags can be found in ` PHP manual <https://www.php.net/manual/en/filter.filters.flags.php >`__.
94+ :returns: `` $_SERVER `` item value if found, null if not
7895 :rtype: mixed
7996
80- This method is identical to the ``post () ``, ``get () `` and ``cookie () `` methods from the
97+ This method is identical to the ``getPost () ``, ``getGet () `` and ``getCookie () `` methods from the
8198 :doc: `IncomingRequest Class </incoming/incomingrequest >`, only it fetches server data (``$_SERVER ``):
8299
83100 .. literalinclude :: request/004.php
@@ -90,13 +107,13 @@ Class Reference
90107 .. php :method :: getEnv([$index = null[, $filter = null[, $flags = null]]])
91108
92109 :param mixed $index: Value name
93- :param int $filter: The type of filter to apply. A list of filters can be found ` here <https://www.php.net/manual/en/filter.filters.php >`__.
94- :param int|array $flags: Flags to apply. A list of flags can be found ` here <https://www.php.net/manual/en/filter.filters.flags.php >`__.
95- :returns: $_ENV item value if found, null if not
110+ :param int $filter: The type of filter to apply. A list of filters can be found in ` PHP manual <https://www.php.net/manual/en/filter.filters.php >`__.
111+ :param int|array $flags: Flags to apply. A list of flags can be found in ` PHP manual <https://www.php.net/manual/en/filter.filters.flags.php >`__.
112+ :returns: `` $_ENV `` item value if found, null if not
96113 :rtype: mixed
97114
98- This method is identical to the ``post () ``, ``get () `` and ``cookie () `` methods from the
99- :doc: `IncomingRequest Class </incoming/incomingrequest >`, only it fetches getEnv data (``$_ENV ``):
115+ This method is identical to the ``getPost () ``, ``getGet () `` and ``getCookie () `` methods from the
116+ :doc: `IncomingRequest Class </incoming/incomingrequest >`, only it fetches env data (``$_ENV ``):
100117
101118 .. literalinclude :: request/006.php
102119
@@ -109,17 +126,17 @@ Class Reference
109126
110127 :param string $method: Method name
111128 :param mixed $value: Data to be added
112- :returns: HTTP request method
113- :rtype: Request
129+ :returns: This request
130+ :rtype: Request
114131
115- Allows manually setting the value of PHP global, like $_GET, $_POST, etc.
132+ Allows manually setting the value of PHP global, like `` $_GET ``, `` $_POST `` , etc.
116133
117134 .. php :method :: fetchGlobal($method [, $index = null[, $filter = null[, $flags = null]]])
118135
119136 :param string $method: Input filter constant
120137 :param mixed $index: Value name
121- :param int $filter: The type of filter to apply. A list of filters can be found ` here <https://www.php.net/manual/en/filter.filters.php >`__.
122- :param int|array $flags: Flags to apply. A list of flags can be found ` here <https://www.php.net/manual/en/filter.filters.flags.php >`__.
138+ :param int $filter: The type of filter to apply. A list of filters can be found in ` PHP manual <https://www.php.net/manual/en/filter.filters.php >`__.
139+ :param int|array $flags: Flags to apply. A list of flags can be found in ` PHP manual <https://www.php.net/manual/en/filter.filters.flags.php >`__.
123140 :rtype: mixed
124141
125142 Fetches one or more items from a global, like cookies, get, post, etc.
0 commit comments