customerLogin is object that I want to send to my service. I do not want to use query string and do not want parameters separately. Below is the code:
var config = {
customerLogin : { // object I intend to send
'EmailID': $scope.existingCustomer.email,
'PhoneNumber': $scope.existingCustomer.phoneNumber,
'Passkey': $scope.existingCustomer.password
}
}
$http.get(existingCustomerUrlConstant, config).
In webapi, i have below code:
[HttpGet]
// customerLogin object i want to receive here
public CustomerLogin GetCustomer(CustomerLogin customerLogin)
{
GetCustomerDAL getCustomerDAL = new GetCustomerDAL(customerLogin);
return customerLogin;
}
customerLogin is null here. How can i receive object here from Angular service call?
HTTP GETyou must use the query string or something in the URL itself. That's just the way that GET works. If you don't want any data in the URL, then you have to use POST, PATCH, PUT, etc...