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:
60
60
61
61
``` csharp
62
62
async Task < string > GetToken () {
63
- var options = new RestClientOptions (_baseUrl );
64
- using var client = new RestClient (options ) {
63
+ var options = new RestClientOptions (_baseUrl ){
65
64
Authenticator = new HttpBasicAuthenticator (_clientId , _clientSecret ),
66
65
};
66
+ using var client = new RestClient (options );
67
67
68
68
var request = new RestRequest (" oauth2/token" )
69
69
.AddParameter (" grant_type" , " client_credentials" );
@@ -107,11 +107,11 @@ public class TwitterClient : ITwitterClient, IDisposable {
107
107
readonly RestClient _client ;
108
108
109
109
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" ){
113
111
Authenticator = new TwitterAuthenticator (" https://api.twitter.com" , apiKey , apiKeySecret )
114
112
};
113
+
114
+ _client = new RestClient (options );
115
115
}
116
116
117
117
public async Task <TwitterUser > GetUser (string user ) {
You can’t perform that action at this time.
0 commit comments