cordova - cordovaHTTP.post body parameters not being sent -
trying use cordovahttp.post method. hitting server(node / express based) fine, however, req.body coming in empty. here code using:
let url = "http://192.168.51.77:8000/beacon/detected"; let data = { somedata: 'foobar' }; let headers = { 'content-type': 'application/json' }; cordovahttp.post(url, data, headers, function (response) { // create tag display beacon data. var element = $( '<div>' // + json.parse(response.headers) + json.parse(response.data).data.content[0].body + '</div>' ); $('#kne-response').html(element); }, function (response) { console.error(response.error); });
Comments
Post a Comment