# Ionic framework http post request

**URL:** <https://forum.ionicframework.com/t/ionic-framework-http-post-request/29195>\
**Category:** ionic-v1\
**Created:** [July 25, 2015, 1:14pm UTC](https://forum.ionicframework.com/t/ionic-framework-http-post-request/29195 "2015-07-25T13:14:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hussainanver52](https://avatars.discourse-cdn.com/v4/letter/h/b5a626/32.png) [@hussainanver52](https://forum.ionicframework.com/u/hussainanver52)\
**Post date:** [July 25, 2015, 1:14pm UTC](https://forum.ionicframework.com/t/ionic-framework-http-post-request/29195/1 "2015-07-25T13:14:59Z")

</div>

Hello every once

I want to send post request to remote php file from ionic app to save base64 encoded data in the database, but when i pass post data i can see the post parameter is sent but when i print post response from php file its blank

I have added the sample code i tried

cotroller.js

```
$http.post("someurl", {data: {"data333": 'peter'}});

```

in php file when i print `$_POST` or `$_REQUEST` its blank array but from my console i can see parameters are passed and its json format {data: {“data333”: ‘peter’}}

i have allowed cross domain in both client and server

i also tried the standard ajax way also

```
$http.defaults.headers.post["Content-Type"] = 'application/x-www-form-urlencoded; charset=UTF-8';
$http({
        method : 'POST',
        url : 'someurl/',
        headers: {
 'Content-Type' : 'application/x-www-form-urlencoded; charset=UTF-8'

```

},  
data : {“key”: “value”}  
})

can anyone help me to pass this data

---

<div class="post-metadata">

**Author:** ![Gajotres](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/gajotres/32/98564_2.png) [@Gajotres](https://forum.ionicframework.com/u/Gajotres)\
**Post date:** [July 26, 2015, 2:02pm UTC](https://forum.ionicframework.com/t/ionic-framework-http-post-request/29195/2 "2015-07-26T14:02:54Z")

</div>

Have you tried using Fiddler (software) to analyze incoming/outgoing server data?

---

<div class="post-metadata">

**Author:** ![btbrad](https://avatars.discourse-cdn.com/v4/letter/b/e480ec/32.png) [@btbrad](https://forum.ionicframework.com/u/btbrad)\
**Post date:** [October 6, 2015, 12:48pm UTC](https://forum.ionicframework.com/t/ionic-framework-http-post-request/29195/3 "2015-10-06T12:48:21Z")

</div>

I’m also finding a similar issue when i use the following from the client side

var url = ‘[http://localhost:8100](http://localhost:8100)’;  
var request = $http.post(url, { params : {“FirstName”: $scope.Model.FName, “LastName”:$scope.Model.LName}},  
{headers: { ‘Content-Type’: ‘application/x-www-form-urlencoded; charset=UTF-8’}});

On the server side I tried using the following combination of statements to read the value. But none of them returns the value and it returns undefined. Can someone help me to resolve this.

```
  console.log("The value of the body is", req.body.FirstName);
  console.log('The value of params is ', req.params.FirstName);
  console.log('The value of body params is ', req.body.params);
  console.log('The value of key is ', keys[0]);
  console.log('The value of param from req.body.Param', req.body.param);
```
