Can I use instance.SetHeader for the Accept-Language HTTP attribute?

  • Автор темы Автор темы kvdd
  • Дата начала Дата начала

kvdd

Client
Регистрация
05.05.2011
Сообщения
37
Реакции
0
Баллы
6
I want to use this code in my program, and have tested it, seems that it does not work:

Код:
Развернуть Свернуть Копировать
instance.SetHeader("Accept-Language", "en-us");

Maybe it is just the website where I run my program what is failing?

Thanks.
 
I want to use this code in my program, and have tested it, seems that it does not work:
Код:
Развернуть Свернуть Копировать
instance.SetHeader("Accept-Language", "en-us");
Maybe it is just the website where I run my program what is failing?Thanks.
Of course you can use it. But some website use another way for languages setting. I should say that I use this method only for setting user agent and all works fine.
In the documentation exist example how to use it.
JavaScript:
Развернуть Свернуть Копировать
instance.SetHeader("HTTP_USER_AGENT", "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0; ZennoPoster)");
I think that you incorrectly set the first parameter. Maybe it should be like this:
JavaScript:
Развернуть Свернуть Копировать
instance.SetHeader("HTTP_ACCEPT_LANGUAGE", "en-us");
 
  • Спасибо
Реакции: kvdd
Thank you, I shall try it out!
 
Yes, you can set only user-agent such way in http headers.
 
  • Спасибо
Реакции: kvdd
So we cannot use it, maybe in version 3?

*Hint hint*
 

Кто просматривает тему: (Всего: 0, Пользователи: 0, Гости: 0)