• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how many bytes can XMLHttpRequest.responseText hold?

 
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have been trying to send a large chuck of data to a JSP file through XMLHttpRequest.responseText. But my data is truncated and I can only receive around 50k instead of 300k which is what I send. Is there a length limit for XMLHttpRequest? If so, is there any way to send a large chuck of data using XMLHttpRequest?

Any advice will be appreciated.

Thank you.

Caly
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is this plain text/JSON. Are you setting this text in the body?

Eric
 
Caly LeeAnn
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's plain text.

I send a XMLHttpRequest to a Servlet in a JSP file. And in the Servlet I use ServletOutputStream to send the data back to the JSP.

I didn't set text/JSON in the header, though. Does it affect the length of the data that can be retrieved?
[ September 06, 2006: Message edited by: Caly LeeAnn ]
 
Caly LeeAnn
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I set the contentType to 'text/JSON' but it doesn't make a difference. I can still only receive around 50k data.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There is no standard mime type text/json. I also don't see what the content type would have to do with this issue.

Are you setting content-length?

If you hit resource directly with the browser, does the entire content body get loaded?
 
Caly LeeAnn
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I set the contentType to 'text/JSON' but it doesn't make a difference. I can still only receive around 50k data.
 
Caly LeeAnn
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Bear,

I didn't set the content length for the XMLHttpRequest. If I send a request through HttpRequest, I don't have this problem.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"text/JSON" isn't a valid mime type either, it should be "text/plain".

What happens if you set the content-length?
reply
    Bookmark Topic Watch Topic
  • New Topic