use crate::http_client::HttpClient;
use std::collections::HashMap;

pub async fn post_request(handle: String, pass: String, host: String) -> String {
    let url = format!("https://{}/xrpc/com.atproto.server.createSession", host);

    let mut map = HashMap::new();
    map.insert("identifier", &handle);
    map.insert("password", &pass);

    let client = HttpClient::new();
    
    match client.post_json(&url, &map).await {
        Ok(response) => response,
        Err(e) => format!("Error: {}", e),
    }
}
