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

My app ionic not sent data

$
0
0

@roma35 wrote:

hi everyone.

I have a problem with send data to restfull service, my service restfull not need key or login. is simple restful services.
well my code is here:

    $scope.SendData = function(){

        var sendData = [
            {
                id_customerorder:idcustomerorder,
                id_cart:idcartsend,
                customer_name:$scope.zupa.nombrecom,
                fb_id:fbid,
                tax_name:$scope.zupa.nombrecom,
                tax_number:$scope.zupa.nit,
                total_price:totalProduct,
                address:$scope.zupa.calle,
                address_number:$scope.zupa.numero,
                address_ref:$scope.zupa.refayuda,
                phone_ref:$scope.zupa.phone,
                latitude:lat,
                longitude:lng,
                order_date:orderdate,
                delivered:delivery
            }];

        var request = JSON.stringify(sendData);
        console.log(request);

zupafactoryio.ZupaSendData(request).success(function(ans){
console.log('ok this data is sent');
console.log(ans);
}).error(function(error){
console.log(error);
});

    }

// services.js file
// this method send data to method customerorders

ZupaSendData:function(datas){
return $http.post('http://web.zupa.delivery/webservice/index.php/customerorders',datas,{ headers: {'Content-Type': 'application/x-www-form-urlencoded'} });
},

but showme an error like this

and I don't know, why I have an error in my JSON like my imagen.

please help me

thanks for your attention

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 49076

Trending Articles



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