Skip to content

Commit

Permalink
modify refresh
Browse files Browse the repository at this point in the history
  • Loading branch information
Kouhei Aoyagi committed Mar 25, 2024
1 parent 258fbb1 commit 1403183
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/api/post_2_oauth2_token_refresh_token.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
use crate::{api::execute_twitter, error::Error, headers::Headers};
use crate::{
api::{execute_twitter, make_url},
error::Error,
headers::Headers,
};
use reqwest::RequestBuilder;
use serde::{Deserialize, Serialize};

const URL: &str = "https://api.twitter.com/2/oauth2/token";
const URL: &str = "/2/oauth2/token";

#[derive(Debug, Clone, Default)]
pub struct Api {
Expand All @@ -28,8 +32,9 @@ impl Api {
];

let client = reqwest::Client::new();
let url = make_url(URL);
client
.post(URL)
.post(url)
.form(&form_parameters)
.basic_auth(&self.api_key_code, Some(&self.api_secret_code))
}
Expand Down

0 comments on commit 1403183

Please sign in to comment.