Page 1 of 1

How to retrieve user-agent from wxWebView(EOM)?

Posted: Thu Jun 30, 2016 4:48 am
by guanlisheng
i am building a wx based application which will send HTTP request to remote sever and wondering whether can i set the user-agent more accurate?

Re: How to retrieve user-agent from wxWebView(EOM)?

Posted: Thu Jun 30, 2016 7:29 am
by doublemax
Are you referring to the "wxWidgets 2.x" user-agent that wxWidgets uses by default?

That depends on how exactly you send the HTTP request. If you have access to a wxHTTP instance, you can use:

Code: Select all

http->SetHeader("User-Agent", "my-user-agent");
http://docs.wxwidgets.org/trunk/classwx ... 46c7218b6e

Re: How to retrieve user-agent from wxWebView(EOM)?

Posted: Tue Jul 05, 2016 10:08 pm
by guanlisheng
Thanks and i wanted to know how to get the user-agent instead of setting.

Re: How to retrieve user-agent from wxWebView(EOM)?

Posted: Wed Jul 06, 2016 5:30 am
by doublemax
Thanks and i wanted to know how to get the user-agent instead of setting.
The question in the title didn't match the question in the other text.

But i don't know a way to check your own user-agent programmatically, what for do you need it?
Manually you can check on sites like: http://www.whoishostingthis.com/tools/user-agent/