0

My problem is that When I am passing large value of string in data it will not call service and go in error.It works fine when string value is small If I am passing large value in value of documentbody then it creates problem. Code:

var requestData = {
                "PostData": [{ "Key": "subject", "Value": "e1 note"},{ "Key": "documentbody", "Value": "", "Datatype": "String" }],
            };


 $.ajax({
    type: "POST",
    url: "http://localhost:32911/Service1.svc/savedata",
    data: JSON.stringify(requestData),
    contentType: "application/json; charset=utf-8",
    dataType: "json",
    success: function (data, status, XMLHttpRequest) {
        debugger;
    },
    error: function (xhr) {
        alert("error"+xhr.responseText);
    }
});

My class in c#:

public class RequestData
{
     [DataMember]
        public List<PostData> PostData { get; set; }
}
 public class PostData
{
    [DataMember]
    public string Key { get; set; }

    [DataMember]
    public string Value { get; set; }
}

Error in console:

"NetworkError: 413 Request Entity Too Large - http://localhost:33919/Service1.svc/savedata"

chhaya_patel
  • 171
  • 1
  • 2
  • 15

0 Answers0