![]() |
Access form-data parameters from a ResourceController method - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=31) +--- Thread: Access form-data parameters from a ResourceController method (/showthread.php?tid=82686) |
Access form-data parameters from a ResourceController method - kabeza - 08-09-2022 Hi I've the following route group configured Code: $routes->group('api/project', ['namespace' => 'App\Controllers\Api', 'filter' => 'apikey'], function ($routes) { However, the main route from the controller, the "/" (GET method) which calls Project::index can/must receive a parameter from body -> form-data Here's my index method from that controller, but cannot access any parameter from form-data using getPost, getGet, etc. Code: public function index() The only way to get the data is with getRawInput, but I get it in a very strange format Code: { Is there a clean way to get the parameters and values from body->form-data in a get method from a ResourceController ? Thanks RE: Access form-data parameters from a ResourceController method - kenjis - 08-09-2022 See https://www.php.net/manual/en/features.file-upload.post-method.php RE: Access form-data parameters from a ResourceController method - iRedds - 08-09-2022 The data is encoded with multipart/form-data. This data encoding is used for uploading files. Don't use it for the GET method and you'll be fine. |