I am developing mobile application for one of my webapp whose all the data resides on server. On post request data will be sent in response in JSON format. I am doing a post request as follows:
$http.defaults.headers.post['Content-Type'] ='application/x-www-form-urlencoded';
$http.post(base_url+"get/memberLogin.php", {'username':userName, 'password':passWord, 'tempKey':'XHJJUQWERgfrbbbbokaw1222344'}...
the data is getting sent in post request as that of i can see in the firebug of firefox browser. But at server side when i do var_dump($_POST)
or var_dump($_REQUEST)
i am getting the empty array. How is it so??? As i am posting data on server, it should be captured using $_POST
but didnt work
Instead if i send data in following format:
$http.post(base_url+"get/memberLogin.php?username="+userName+"&password="+passWord, {}...
I am getting parameter values at server side using $_REQUEST
. What is the problem with $_POST
??