Boost logo

Boost Users :

Subject: Re: [Boost-users] ASIO: HTTP Client Issues with \r vs \n
From: Igor R (boost.lists_at_[hidden])
Date: 2012-01-31 06:49:29

> 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 ( 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.

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at