Unable to get the json values in from react-native to codeigniter - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Development (https://forum.codeigniter.com/forumdisplay.php?fid=6) +--- Forum: CodeIgniter 3.x (https://forum.codeigniter.com/forumdisplay.php?fid=17) +--- Thread: Unable to get the json values in from react-native to codeigniter (/showthread.php?tid=75229) |
Unable to get the json values in from react-native to codeigniter - Imran Khan - 01-15-2020 Hi Everyone, I am trying to send the email and password through react native but i am unable to get the posted values in codeigniter. Here is api call from react native Code: export const api = async (url, method, body = null, headers = {}) => { Datasent is in this form Code: {"email":"[email protected]","password":"1234"} In codeigniter i am trying to get like this Code: $email = $this->input->post('email'); Other way i used but nothing is working.like Code: $rawData = file_get_contents("php://input"); Thanks in advance. RE: Unable to get the json values in from react-native to codeigniter - nc03061981 - 01-15-2020 The first, you make a get from react native, if it okie, and then you can post it RE: Unable to get the json values in from react-native to codeigniter - jreklund - 01-15-2020 If it truly sends it into php://input stream you can get that data like this: https://codeigniter.com/user_guide/libraries/input.html?#using-the-php-input-stream $this->input->raw_input_stream; |