net-cat 0.1.0

Minimal hand-rolled HTTP/1.1 client over std::net::TcpStream. Plain HTTP only in v0 (no TLS); used to give web-api-cat's fetch a concrete backend. No external HTTP crate; all parsing and framing are local. No mut beyond the FFI carve-out for TcpStream::read_to_end. Sixth sub-crate of a Servo-replacement webview runtime targeting Tauri.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! `fetch` -- the high-level entry point.

use crate::error::Error;
use crate::request::Request;
use crate::response::Response;
use crate::transport;

/// Execute `request` and return the parsed response.
///
/// # Errors
///
/// See [`Error`].  In particular, `https://` URLs return
/// [`Error::UnsupportedScheme`] in v0.
pub fn fetch(request: &Request) -> Result<Response, Error> {
    transport::exchange(request)
}