diff --git a/docs/usage.md b/docs/usage.md index 150df78f8..424582f78 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -60,10 +60,10 @@ Now, we need to implement the `GetToken` function in the class: ```csharp async Task GetToken() { - var options = new RestClientOptions(_baseUrl); - using var client = new RestClient(options) { + var options = new RestClientOptions(_baseUrl){ Authenticator = new HttpBasicAuthenticator(_clientId, _clientSecret), }; + using var client = new RestClient(options); var request = new RestRequest("oauth2/token") .AddParameter("grant_type", "client_credentials"); @@ -107,11 +107,11 @@ public class TwitterClient : ITwitterClient, IDisposable { readonly RestClient _client; public TwitterClient(string apiKey, string apiKeySecret) { - var options = new RestClientOptions("https://api.twitter.com/2"); - - _client = new RestClient(options) { + var options = new RestClientOptions("https://api.twitter.com/2"){ Authenticator = new TwitterAuthenticator("https://api.twitter.com", apiKey, apiKeySecret) }; + + _client = new RestClient(options); } public async Task GetUser(string user) {