Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Newbie corner » HttpClient and language choice (HTTP_ACCEPT_LANGUAGE)
HttpClient and language choice (HTTP_ACCEPT_LANGUAGE) [message #32873] Thu, 16 June 2011 18:20 Go to next message
jibe is currently offline  jibe
Messages: 294
Registered: February 2007
Location: France
Experienced Member
Hi,

Web browsers send a HTTP_ACCEPT_LANGUAGE header so that you can obtain the page in your own language. I should like to have the same when I get some page with HttpClient. Is it possible ? How can I do ?
Re: HttpClient and language choice (HTTP_ACCEPT_LANGUAGE) [message #32881 is a reply to message #32873] Fri, 17 June 2011 14:21 Go to previous messageGo to next message
jibe is currently offline  jibe
Messages: 294
Registered: February 2007
Location: France
Experienced Member
I tried to add
client.AddHeaders("Accept-Language: fr-fr, fr, en");

before calling
content = client.ExecuteRedirect();

but it freezes on the ExecuteRedirect()...

Is there some doc or example that could help me ?
Re: HttpClient and language choice (HTTP_ACCEPT_LANGUAGE) [message #32882 is a reply to message #32881] Fri, 17 June 2011 15:10 Go to previous messageGo to next message
Sender Ghost is currently offline  Sender Ghost
Messages: 301
Registered: November 2008
Senior Member
jibe wrote on Fri, 17 June 2011 14:21

I tried to add
client.AddHeaders("Accept-Language: fr-fr, fr, en");



Try this:
client.AddHeaders("Accept-Language: fr-fr, fr, en\r\n");


Re: HttpClient and language choice (HTTP_ACCEPT_LANGUAGE) [message #32916 is a reply to message #32873] Mon, 20 June 2011 09:01 Go to previous message
jibe is currently offline  jibe
Messages: 294
Registered: February 2007
Location: France
Experienced Member
Hi,

Yes, it works ! Smile

... So, it was that simple ! Sorry that I did not think about that ! Thanks a lot Smile
Previous Topic: String to std::string conversion
Next Topic: DropTree: Select only leaf nodes
Goto Forum:
  


Current Time: Fri Mar 29 01:06:39 CET 2024

Total time taken to generate the page: 0.01155 seconds