/// Claim a username and get a token
///
/// # Arguments
///
/// * `username` - A string containing the username to get a token for
Claim a username and get a token
Claim a username and get a token
pub async fn claim_username(http_client: HttpClient, username: String) -> Result<responses::ClaimUsername, SpaceTradersClientError> {
    let http_client = http_client.lock().await;
    let response = http_client.execute_request(
        "POST",
        &format!("https://api.spacetraders.io/users/{}/token", username),
        Some("{\"message\":\"this body doesn't actually matter\"}"),
        None,
    )
        .await?;
    parse_response::<responses::ClaimUsername>(&response.response_text)
}
pub async fn claim_username ( http_client : HttpClient , username : String ) -> Result < responses :: ClaimUsername , SpaceTradersClientError > { let http_client = http_client . lock ( ) . await ; let response = http_client . execute_request ( " " , & format ! ( " " username ) , Some ( " \" \" \" \" " ) , None , ) . await ? ; parse_response :: < responses :: ClaimUsername > ( & response . response_text ) }
Claim a username and get a token
Claim a username and get a token
http_client
HttpClient
username
String