You need to pass data using the data
keyword in the $http
service API function. In the below code, you can see that we have created a JavaScript object myData
with CustomerName
property. This object is passed in the $http
function using HTTP POST
method.
Var myData = {};
myData.CustomerName = "Test";
$http({ method: "POST",
data: myData,
url: "http://www.xyz.com"})
.success(function (data, status, headers, config)
{
}