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

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -