Today I ran into a UserAgent encoding issue when I tried to use HttpWebRequest to send a request.
Usually UserAgent consists of latin letters and punctuation marks. However, I need to simulate the web requests of an iOS application in which the UA contains some Unicode characters (especially Chinese).
Using Fiddler to receive a raw request, I found that the application used Unicode encoding in its UA. I could not send it to C #; I got this error:
You cannot send Unicode to UserAgent. But it is really important for my project. Now I can simulate an application request without UA bytes.
How can I change UA encoding?
source
share