private async Task <String> GetBearerToken(Twitter.Credentials creds) { var request = new HttpRequestMessage() { RequestUri = new Uri("https://api.twitter.com/oauth2/token"), Method = HttpMethod.Post }; request.Headers.Authorization = new AuthenticationHeaderValue("Basic", creds.toBearerTokenCredentials()); request.Content = new StringContent("grant_type=client_credentials", Encoding.UTF8, "application/x-www-form-urlencoded"); HttpResponseMessage res = await httpClient.SendAsync(request); res.EnsureSuccessStatusCode(); return(await res.Content.ReadAsStringAsync()); }
public Base(String token, String secret) { this.credentials = new Twitter.Credentials(token, secret); }