Unable to get the json values in from react-native to codeigniter |
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.
The first, you make a get from react native, if it okie, and then you can post it
Learning CI4 from my works, from errors and how to fix bugs in the community Love CI & Thanks CI Teams
If it truly sends it into php://input stream you can get that data like this:
https://codeigniter.com/user_guide/libra...put-stream $this->input->raw_input_stream; |
Welcome Guest, Not a member yet? Register Sign In |