Using Codeigniter as RestAPI (using Axios) |
Reading the documentation, $this->validate() will validate the input data based on the request type. So if you have a GET request, it will validate the $_GET data. If you have a POST (or PUT?) request, it will validate the $_POST data.
This seems to happen transparently. You simply use the $this->validate() call as a gateway to control the flow. You don't need to see the data at this point, only set up your validation rules that must pass. Read about this here: http://codeigniter.com/user_guide/incomi...ating-data The boolean logic would be:
If you need access to the request data after the validation runs, you can call $this->request->getPost(), for example. Read about that here: http://codeigniter.com/user_guide/incomi...quest.html# |
Messages In This Thread |
Using Codeigniter as RestAPI (using Axios) - by shinseiten - 10-01-2020, 03:04 AM
RE: Using Codeigniter as RestAPI (using Axios) - by nc03061981 - 10-04-2020, 01:49 AM
RE: Using Codeigniter as RestAPI (using Axios) - by shinseiten - 10-12-2020, 03:08 PM
RE: Using Codeigniter as RestAPI (using Axios) - by connectgrid - 10-13-2020, 06:17 AM
RE: Using Codeigniter as RestAPI (using Axios) - by shinseiten - 10-14-2020, 07:26 AM
RE: Using Codeigniter as RestAPI (using Axios) - by nicojmb - 10-14-2020, 01:03 PM
|