Skip to content

Commit 8d74f47

Browse files
committed
docs: add note for getVar()
1 parent 8726c5b commit 8d74f47

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

user_guide_src/source/incoming/incomingrequest.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,12 @@ With CodeIgniter's built-in methods you can simply do this:
8383
Getting Data
8484
============
8585

86-
The ``getVar()`` method will pull from ``$_REQUEST``, so will return any data from ``$_GET``, ``$POST``, or ``$_COOKIE`` (depending on PHP ini settings). While this
86+
The ``getVar()`` method will pull from ``$_REQUEST``, so will return any data from ``$_GET``, ``$POST``, or ``$_COOKIE`` (depending on php.ini `request-order <https://www.php.net/manual/en/ini.core.php#ini.request-order>`_).
87+
88+
.. note:: If the incoming request has a ``CONTENT_TYPE`` header set to ``application/json``,
89+
the ``getVar()`` method returns the JSON data instead of ``$_REQUEST`` data.
90+
91+
While this
8792
is convenient, you will often need to use a more specific method, like:
8893

8994
* ``$request->getGet()``

0 commit comments

Comments
 (0)