I am new to ionic2 and a bit confused about the best approach to retrieve the request send from app to a php file..
I am integrating my app with laravel PHP framework .. Currently I am able to access request if using
$postdata = file_get_contents("php://input");
Here I am posting data to php server using ionic2:
this.http.post('http://localhost/lara/blog/public/api/apis/login', JSON.stringify({email: email,password: password}), { headers: headers }).map(res => res.json()).subscribe(data => {
});
public function apiLogin(Request $request)
Actually the issue is that when using postman I am able to get request in $request but when sending from ionic2 I am not getting it in $request but getting in $postdata..
So whats the correct way to retrieve in PPH or if I am sending it in a wrong way ..
Can any one please suggest?