ASIO: HTTP Client Issues with \r vs \n
Hello, I'm trying to use the HTTP client example code (sync_cleint.cpp) to retrieve a jpg. I'm using VS2008 on a Windows XP machine and trying to access a Linux server. The resulting data I get back does not start the new lines at the same place as data I retrieve by simply downloading. I believe this is an issue with how windows interprets a new line, \r\n, versus how unix/linux interprets a new line, \n. The example code (http://www.boost.org/doc/libs/1_48_0/doc/html/boost_asio/example/http/client...) uses \r\n, \n, and \r, so I'm a little confused on how to rectify the problem. Any suggestions to correct this for my case (hard code) or automatically detect would be greatly appreciated. P.S. I'm using boost 1.48.0 Thank you, Bo
I'm trying to use the HTTP client example code (sync_cleint.cpp) to retrieve a jpg. I'm using VS2008 on a Windows XP machine and trying to access a Linux server. The resulting data I get back does not start the new lines at the same place as data I retrieve by simply downloading. I believe this is an issue with how windows interprets a new line, \r\n, versus how unix/linux interprets a new line, \n. The example code (http://www.boost.org/doc/libs/1_48_0/doc/html/boost_asio/example/http/client...) uses \r\n, \n, and \r, so I'm a little confused on how to rectify the problem. Any suggestions to correct this for my case (hard code) or automatically detect would be greatly appreciated.
You shouldn't detect anything, just ensure that you open and read jpg file as *binary*, on the server side.
participants (2)
-
Fitzsimmons, Bo CIV SPAWARSYSCEN-PACIFIC, 81320
-
Igor R