Hi I am facing issue over angular http post method. If i try to send data using angularjs http post it sends data as a query string. as I am passing very huge data it gives me error : the server responded with a status of 414 (Request-URI Too Long).
here is my http post factory method:
dataFactory.InsertInAdditionalDataDetailsIdBulk = function (AdditionalDataDetailsIds, AdditionalDataID,
AdditionalDataName, AdditionalDataDate) {
var params = {
AdditionalDataDetailsIds: AdditionalDataDetailsIds,
AdditionalDataID: AdditionalDataID,
AdditionalDataName: AdditionalDataName,
AdditionalDataDate: AdditionalDataDate
}
return $http({
url: '/GroupsManager/InsertInAdditionalDataDetailsIdBulk',
method: 'POST',
params: params
});
};
Why my data is sent as query string parameter even after using Post method?
Put params in the data key..
return $http({
url: '/GroupsManager/InsertInAdditionalDataDetailsIdBulk',
method: 'POST',
data: params
});
https://docs.angularjs.org/api/ng/service/$http
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With