Crates.io | retina-fetch |
lib.rs | retina-fetch |
version | 0.3.0 |
source | src |
created_at | 2023-08-27 14:01:56.285379 |
updated_at | 2023-08-27 14:01:56.285379 |
description | This crate implements the Fetch API, for the Retina browser, but can be used independently. |
homepage | https://github.com/usadson/retina/tree/main/retina-fetch |
repository | https://github.com/usadson/retina |
max_upload_size | |
id | 956097 |
size | 63,964 |
This crate provides the Fetch API implementation for the Retina Browser, but can be used independently. It currently covers some of the specification, with full intention to conform to all of the Fetch Standard and HTTP, as well as the W3C Web App.
cargo add retina-fetch
use retina_fetch::{Fetch, Request};
use url::Url;
#[tokio::main]
async fn main() {
let fetch = Fetch::new();
let url = Url::parse("https://example.org/").unwrap();
let request = Request::get_document(url, Default::default());
let response = fetch.fetch(request).await.unwrap();
println!("Response {response:#?}");
}