Search code examples
asp.net-web-apiuser-agentfiddlerrestsharp

What User-Agent to give my WebApi Requests?


I am using an api and I noticed that when I use RestSharp and do a call from my asp.net web api project my request fails.

I turned on fiddler and for whatever reason the api I am requesting thinks I am a mobile device and thus is redirecting me to the mobile site that does not support api calls.

I then did a request in fiddler and I can access the api. I changed my user-agent to fiddler through restsharp and now my requests go through when using my web api.

I don't want to leave it fiddler though. What should I use instead?


Solution

  • You are in-effect creating your own user-agent, so invent your own identifier. E.g. choboAgent/1.0