Skip to main content

Crate artiqwest

Crate artiqwest 

Source
Expand description

§Artiqwest

Artiqwest is a simple HTTP client that routes all requests through the Tor network using the arti_client and hyper. It provides two basic primitives: get and post functions.

§Example

use artiqwest::get;
use artiqwest::post;

#[tokio::main]
async fn main() {
        // Make a GET request to httpbin.org
        let response = get("https://httpbin.org/get", None, None).await.unwrap();
        assert_eq!(response.status(), 200);

        // Make a POST request to a hidden service
        let body = r#"{"test": "testing"}"#;
        let headers = vec![("Content-Type", "application/json")];
        let response = post("http://vpns6exmqmg5znqmgxa5c6rgzpt6imy5yzrbsoszovgfipdjypnchpyd.onion/echo", body, Some(headers), None).await.unwrap();
        assert_eq!(response.to_string(), body);
}

Structs§

Response
Response from the server with the request that was made included.

Functions§

get
Send GET request to the specified URI over the TOR network.
post
Send POST request to the specified URI over the TOR network.
ws
Get a websocket connection to the specified URI over the TOR network.