htb-cli 0.1.9

Hack The Box CLI
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use crate::error::HtbError;

use super::HtbClient;

pub struct SearchApi<'a>(pub(crate) &'a HtbClient);

impl SearchApi<'_> {
    pub async fn fetch(&self, query: &str) -> Result<serde_json::Value, HtbError> {
        let encoded = super::encode_path(query);
        self.0
            .get(&format!("/api/v4/search/fetch?query={encoded}"))
            .await
    }
}