File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -80,6 +80,8 @@ With CodeIgniter's built-in methods you can simply do this:
8080
8181.. literalinclude :: incomingrequest/008.php
8282
83+ .. _incomingrequest-getting-data :
84+
8385Getting Data
8486============
8587
@@ -103,6 +105,8 @@ maintaining the ability to control the order you look for it:
103105* ``$request->getPostGet() `` - checks ``$_POST `` first, then ``$_GET ``
104106* ``$request->getGetPost() `` - checks ``$_GET `` first, then ``$_POST ``
105107
108+ .. _incomingrequest-getting-json-data :
109+
106110Getting JSON Data
107111=================
108112
@@ -138,6 +142,8 @@ correct ``Content-Type`` header.
138142
139143.. note :: See the documentation for :php:func:`dot_array_search()` in the ``Array`` helper for more information on "dot" notation.
140144
145+ .. _incomingrequest-retrieving-raw-data :
146+
141147Retrieving Raw Data (PUT, PATCH, DELETE)
142148========================================
143149
Original file line number Diff line number Diff line change @@ -286,6 +286,15 @@ data to be validated:
286286
287287.. literalinclude :: validation/008.php
288288
289+ .. note :: This method gets JSON data from
290+ :ref: `$request->getJSON() <incomingrequest-getting-json-data >`
291+ when the request is a JSON request (``Content-Type: application/json ``),
292+ or gets Raw data from
293+ :ref: `$request->getRawInput() <incomingrequest-retrieving-raw-data >`
294+ when the request is a PUT, PATCH, DELETE request and
295+ is not HTML form post (``Content-Type: multipart/form-data ``),
296+ or gets data from :ref: `$request->getVar() <incomingrequest-getting-data >`.
297+
289298Working with Validation
290299***********************
291300
You can’t perform that action at this time.
0 commit comments