In my application I make a few POST requests. I would like to simulate the client default browser user-agent because some websites make the most absurd checks.
Right now I just have a static one like this:
request.setRawHeader("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:26.0) Gecko/20100101 Firefox/26.0");
How can I make this dynamic?
Can you use windows API ObtainUserAgentString?
HRESULT ObtainUserAgentString(
_In_ DWORD dwOption = 0,
_Out_ LPCSTR *pcszUAOut,
_Out_ DWORD *cbSize
);
http://msdn.microsoft.com/en-us/library/ms775114(v=vs.85).aspx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With