use super::EndpointError;
use reqwest::Client;
use serde_derive::Serialize;
pub async fn logout(
client: &Client,
hostname: &str,
token: &str,
) -> Result<(), EndpointError> {
let data = Data {
method: "cli",
noredirect: 1,
token,
};
super::send(client, hostname, "logout.php", &data).await?;
Ok(())
}
#[derive(Debug, Serialize)]
struct Data<'a> {
method: &'a str,
noredirect: usize,
token: &'a str,
}