Could someone please help me troubleshoot this $http.post call? I'm getting a bad request and the server is receiving an empty json body.
var data = JSON.stringify({
"Name": $scope.device.ChildName,
"Serial": $scope.device.Serial
});
console.log($scope.device.Serial);
console.log($scope.device.ChildName);
console.log(data);
$http.post('http://141.135.5.117:3500/device/register', data, { headers: headers })
.then(function(response){
console.log(response);
console.log(headers);
});
Here are my headers:
var headers = {
"Content-Type": "application/json;" ,
"Authorization" : JWT
};
Just a note: JWT is being used for Authorization.
Thank you!