Answer the question
In order to leave comments, you need to log in
Long server response with a Post request of 100kb, why?
I am using angularjs http(post), asp.net vnext backend running on iis or kestrel
My request is urlencoded:
$scope.editTextSave = function (bookid, partbookId, textOfBookId) {
$http({
method: "POST",
data: "TextBook=" + encodeURIComponent($scope.htmlcontent),
url: '/Text/EditSave/' + bookid + '/' + partbookId + '/' + textOfBookId,
type: 'POST',
headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
}).success(function (data) {
});
}
Answer the question
In order to leave comments, you need to log in
request with json data passing, on angularjs http
$scope.editTextSave = function (bookid, partbookId, textOfBookId) {
$http({
url: '/Text/EditSave/' + bookid + '/' + partbookId + '/' + textOfBookId,
method: 'POST',
data: JSON.stringify({
TextId: textOfBookId,
TextBook:$scope.htmlcontent,
BookId: bookid,
PartId: partbookId
}),
headers: { 'Content-Type': 'application/json' },
transformRequest: false
}).success(function (data) {
});
};
[HttpPost]
[Route("Text/EditSave/{booklink?}/{partbookId?}/{textOfBookId?}")]
public async Task<bool> EditSave([FromBody]TextOfBookViewModel model)
{
return true;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question