I POST some data to an API using POSTMAN. (screenshot attached) like this …
Objective : Now I’m trying to do the same i.e POST the same through Angular js 1.3 code.
Problem : In POSTMAN (shown in pic). I select x-www-form-urlencoded to send data.
Likewise in Angular JS 1.3 How do I send x-www-form-urlencoded ?
Here is the Angular code. I am not sure where to put x-www-form-urlencoded in this code.
var callTokenAPI = function (dataObj) {
console.log("Call server dataObj =" + angular.toJson(dataObj));
return $http({
url: tokenAPIurl,
method: 'POST',
data: dataObj,
headers: { "Content-Type": "application/json;charset=utf-8" }
});
};