Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49196

Http Post not working

$
0
0

@anicacute09 wrote:

Hi guys, I am doing an app with http request. I already have a Rest Api for POST/GET and as I use the get i works already. Now my problem is the post method, if I use test app for my post api(postman) it works but when I use it in my ionic app it always return to me something wrong with posting data.. Hope you help me with this one.

Here is my code in my Http Post method :

$http.post("http://dev.colombiandreamdate.com/api/v1/createuser",
          { data: {
            first_name: $scope.data1.fname,
            last_name: $scope.data1.lname,
            username: $scope.data1.email,
            password: $scope.data1.pass,
            skype_id: $scope.data1.skype,
            location_address: $scope.data1.city,
            gender: $scope.data1.gender,
            birthday: $scope.data1.birthday,
            heading: $scope.data2.heading,
            about: $scope.data2.descriptions,
            marital_status: $scope.data2.status,
            occupation: $scope.data2.work,
            height: $scope.data2.uheight,
            hair_color: $scope.data2.uhair,
            body_type: $scope.data2.ubody,
            nationality: $scope.data2.unation,
            ethnicity: $scope.data2.uethni,
            english_ability: $scope.data2.uenglish,
            spanish_ability: $scope.data2.uspanish,
            living_situation: $scope.data2.uliving,
            willing_to_relocate: $scope.data2.urelocate,
            match_gender: $scope.data2.umatchgender,
            match_min_age: $scope.data2.uagefrom,
            match_max_age: $scope.data2.uageto
          }
        })
          .success(function (response) {
           console.log(response);
          })
          .error(function (response) {
            console.log(response);
            console.log("Error in submitting");
          });

Posts: 3

Participants: 3

Read full topic


Viewing all articles
Browse latest Browse all 49196

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>