[][src]Module localghost::net

Browser networking APIs

Examples

use localghost::prelude::*;
use localghost::{log, net};
use std::io;

#[localghost::main]
async fn main() -> io::Result<()> {
    let res = net::Request::get("https://example.com").send().await?;
    log::info!("status: {:?}", res.status());
    log::info!("body: {:?}", res.body_string().await?);
    Ok(())
}

Structs

Beacon

Asynchronously send a small amount of data to an HTTP server.

Body

A fetch body.

EventSource

A receiver of Server Sent Events (SSE).

HeadersIter

HTTP Headers Iterator.

MessageEvent

An SSE event with a data payload.

Request

An HTTP Fetch Request.

Response

An HTTP Fetch Response.

Enums

ReadyState

The state of the SSE connection.