unnecessary and arbitrary new line character in response
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   dmay_dmay
Posted On:   Wednesday, January 17, 2007 01:51 AM

I get the response from server using xmlHttp.responseText.
I send a very long string .This string is a json object .This string is single line .When i output that string to text file in server it shows no line break but when i receive that string in client it contains some unnecessary and arbitrary line break.Because of that i not able to parse that string successfully .I want to remove that line break and why there are line break .
Thanks

Re: unnecessary and arbitrary new line character in response

Posted By:   Christopher_Koenigsberg  
Posted On:   Wednesday, January 17, 2007 09:07 AM

The http protocol allows the server to split up a long line by inserting newlines at arbitrary places, I think; most Internet protocols do?



The receiver is supposed to ignore them. That's one reason for "content-transfer-encoding" in email, to guard your real/significant line breaks and distinguish them from extra ones just inserted in transit.



Perhaps you should first remove any newlines (linefeeds and/or carriage returns) from your string, before parsing it?
About | Sitemap | Contact