From c846418df6f9fe6a6fff431a6bc977358e6ffea0 Mon Sep 17 00:00:00 2001 From: Mavaddat Javid <5055400+mavaddat@users.noreply.github.com> Date: Fri, 20 Oct 2023 20:19:56 -0400 Subject: [PATCH 1/2] Update usage.md Conform to updated API --- docs/usage.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/usage.md b/docs/usage.md index 150df78f8..001204f32 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"); From 83f9e0f7a35bd58c8c29a38129d9658c0f7da2bf Mon Sep 17 00:00:00 2001 From: Mavaddat Javid <5055400+mavaddat@users.noreply.github.com> Date: Fri, 20 Oct 2023 20:22:15 -0400 Subject: [PATCH 2/2] Update usage.md Conform the latest API --- docs/usage.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/usage.md b/docs/usage.md index 001204f32..424582f78 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -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) {