How to use OAuth2 in RestSharp
After a couple of days sorting out OAuth2 at the server-end (Spring java) I started working on the client written in C#. I am using RestSharp to call my web API but I am having real difficulty with the OAuth2. There is hardly any documentation and the few examples I found online do not work. Can someone provide me a code sample that is up to date and that I can use? So far I have the following: var client = new RestClient("http://example.com/myapi/oauth/token"); RestRequest request = new RestRequest() { Method = Method.POST }; request.AddHeader("Content-Type", "application/json"); request