File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -60,10 +60,10 @@ Now, we need to implement the `GetToken` function in the class:
6060
6161``` csharp
6262async Task < string > GetToken () {
63- var options = new RestClientOptions (_baseUrl );
64- using var client = new RestClient (options ) {
63+ var options = new RestClientOptions (_baseUrl ){
6564 Authenticator = new HttpBasicAuthenticator (_clientId , _clientSecret ),
6665 };
66+ using var client = new RestClient (options );
6767
6868 var request = new RestRequest (" oauth2/token" )
6969 .AddParameter (" grant_type" , " client_credentials" );
@@ -107,11 +107,11 @@ public class TwitterClient : ITwitterClient, IDisposable {
107107 readonly RestClient _client ;
108108
109109 public TwitterClient (string apiKey , string apiKeySecret ) {
110- var options = new RestClientOptions (" https://api.twitter.com/2" );
111-
112- _client = new RestClient (options ) {
110+ var options = new RestClientOptions (" https://api.twitter.com/2" ){
113111 Authenticator = new TwitterAuthenticator (" https://api.twitter.com" , apiKey , apiKeySecret )
114112 };
113+
114+ _client = new RestClient (options );
115115 }
116116
117117 public async Task <TwitterUser > GetUser (string user ) {
You can’t perform that action at this time.
0 commit comments