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

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
guanlisheng
Earned a small fee
Earned a small fee
Posts: 14
Joined: Wed Apr 25, 2012 2:45 am

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

Post by guanlisheng » Thu Jun 30, 2016 4:48 am

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?
Lisheng Guan (guanlisheng.com)

Developer of Money Manager Ex

User avatar
doublemax
Moderator
Moderator
Posts: 14958
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

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

Post by doublemax » Thu Jun 30, 2016 7:29 am

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
Use the source, Luke!

guanlisheng
Earned a small fee
Earned a small fee
Posts: 14
Joined: Wed Apr 25, 2012 2:45 am

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

Post by guanlisheng » Tue Jul 05, 2016 10:08 pm

Thanks and i wanted to know how to get the user-agent instead of setting.
Lisheng Guan (guanlisheng.com)

Developer of Money Manager Ex

User avatar
doublemax
Moderator
Moderator
Posts: 14958
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

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

Post by doublemax » Wed Jul 06, 2016 5:30 am

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/
Use the source, Luke!

Post Reply