Skip to main content

Module request

Module request 

Source
Expand description

Request types used by the crawler runtime.

Request is the runtime’s transport-neutral request model. It stores the URL, method, headers, optional body, and a lazily allocated metadata map used by middleware and runtime internals.

§Example

use spider_util::request::{Request, Body};
use url::Url;
use serde_json::json;

// Create a simple GET request
let url = Url::parse("https://example.com").unwrap();
let request = Request::new(url);

// Create a POST request with JSON body
let post_request = Request::new(Url::parse("https://api.example.com/data").unwrap())
    .with_method(reqwest::Method::POST)
    .with_json(json!({"key": "value"}));

Structs§

Request
Outgoing HTTP request used by the crawler runtime.

Enums§

Body
Request body variants supported by the default downloader.