c# - JQuery ajax with big data returns 404 -


i have ajax request can have long data (more 2000 characters). i'm getting 404 server. how can solve this?

var data= { data: /*some long text*/'far far away, behind word mountains, far countries vokalia , consonantia, there live blind texts. separated live in bookmarksgrove right @ coast of semantics, large language ocean. small river named duden flows place , supplies necessary regelialia. paradisematic country, in roasted parts of sentences fly mouth. all-powerful pointing has no control blind texts unorthographic life 1 day small line of blind text name of lorem ipsum decided leave far world of grammar. big oxmox advised not so, because there thousands of bad commas, wild question marks , devious semikoli, little blind text didn’t listen. packed 7 versalia, put initial belt , made herself on way. when reached first hills of italic mountains, had last view on skyline of hometown bookmarksgrove, headline of alphabet village , subline of own road, line lane. pityful rethoric question ran on cheek, continued way. on way met copy. copy warned little blind text, came have been rewritten thousand times , left origin word "and" , little blind text should turn around , return own, safe country. nothing copy said convince , didn’t take long until few insidious copy writers ambushed her, made drunk longe , parole , dragged agency, abused projects again , again. , if hasn’t been rewritten, still using her. far far away, behind word mountains, far countries vokalia , consonantia, there live blind texts. separated live in bookmarksgrove right @ coast of semantics, large language ocean. small river named duden flows place , supplies necessary regelialia. paradisematic country, in roasted parts of sentences fly mouth. all-powerful pointing has no control blind texts unorthographic life 1 day small line of blind text name of lorem ipsum decided leave far world of grammar. big oxmox advised not so, because there thousands of bad commas, wild question marks , devious semikoli, little blind text didn’t listen. packed 7 versalia, put initial belt , made herself on way. when reached first hills of italic mountains, had last view on skyline of hometown bookmarksgrove, headline of alphabet village , subline of own road, line lane. pityful rethoric question ran on cheek, continued way. on way met copy. copy warned little blind text, came have been rewritten thousand times , left origin word "and" , little blind text should turn around , return own, safe country. nothing copy said convince , didn’t take long until few insidious copy writers ambushed her, made drunk longe , parole , dragged agency, abused projects again , again. , if hasn’t been rewritten, still using her. far far away, behind word mountains, far countries vokalia , consonantia, there live blind texts. separated live in bookmarksgrove right @ coast of semantics, large language ocean. small river named duden flows place , supplies necessary regelialia. paradisematic country, in roasted parts of sentences fly mouth. all-powerful pointing has no control blind texts unorthographic life 1 day small line of blind text name of lorem ipsum decided leave far world of grammar. big oxmox advised not so, because there thousands of bad commas, wild question marks , devious semikoli, little blind text didn’t listen. packed 7 versalia, put initial belt , made herself on way. when reached first hills of italic mountains, had last view on skyline of hometown bookmarksgrove, headline of alphabet village , subline of own road, line lane. pityful rethoric question ran on cheek, continued way. on way met copy. copy warned little blind text, came have been rewritten thousand times , left origin word "and" , little blind text should turn around , return own, safe country. nothing co' } $.ajax({     url: url,     type: "post",     datatype: "json",     data: data,     success: onsuccess,     error: onerror   }); 

i have server method:

[httppost] public dynamic posttext(string data) {             return data.length; } 

i'm using mssqlserver , iis 8.5.9600

i've tried set maxrequestlength here didn't help

maybe there way send data? can send in "message-body" section. have no idea how it. didn't find info that. i've tried send dhc , data body.

var s = new system.io.streamreader(system.web.httpcontext.current.request.inputstream).readtoend(); 

so question how add data body in ajax?

what http server using?

have tried adding following web.config?

<system.webserver> <security>     <requestfiltering>         <requestlimits maxallowedcontentlength="1000000" />     </requestfiltering> </security> <system.webserver> 

this bump allowed content length megabyte. also, may want set maxreceivedmessagesize attribute of wcf bindings more default 64k:

<webhttpbinding>     <binding name="messagesizeweb" maxreceivedmessagesize="2147483647" /> </webhttpbinding> 

also might need change appsettings in web.config:

<appsettings>   <add key="aspnet:maxjsondeserializermembers" value="400000" /> </appsettings> 

you can try:

  1. launch "internet information services (iis) manager"
  2. expand server field
  3. expand sites
  4. select site want make modification for.
  5. in features section, double click "configuration editor"
  6. under "section" select: system.webserver>serverruntime
  7. modify "uploadreadaheadsize" section
  8. click apply

Comments