README

mizchi/x/http does not have a README file

#
HttpError

pub suberror HttpError {
NetworkError(String)
InvalidUrl(String)
TimeoutError
NotSupported
} derive(
Debug
)

impl Show for HttpError

#
Addr

pub(all) struct Addr {
text : String
port : Int
}

#
Client

pub struct Client {
inner :
Client

// private fields
}

impl Reader for Client
impl Writer for Client

#
Client::close

fn Client::close(self : Client) -> Unit

#
Client::end_request

async fn Client::end_request(self : Client) -> Response raise HttpError

#
Client::enter_passthrough_mode

async fn Client::enter_passthrough_mode(self : Client) -> Unit raise HttpError

#
Client::flush

async fn Client::flush(self : Client) -> Unit raise HttpError

#
Client::get

async fn Client::get(self : Client, path : String, extra_headers? : Map[String, String], body? : &
Data
) -> Response raise HttpError

#
Client::new

async fn Client::new(url : String, headers? : Map[String, String], proxy? : Client, verify? : Bool, trust? :
TrustedRoot
) -> Client raise HttpError

#
Client::post

async fn Client::post(self : Client, path : String, body : &
Data
, extra_headers? : Map[String, String]) -> Response raise HttpError

#
Client::put

async fn Client::put(self : Client, path : String, body : &
Data
, extra_headers? : Map[String, String]) -> Response raise HttpError

#
Client::request

async fn Client::request(self : Client, meth : RequestMethod, path : StringView, extra_headers? : Map[String, String]) -> Unit raise HttpError

#
Client::skip_response_body

async fn Client::skip_response_body(self : Client) -> Unit raise HttpError

pub struct Cookie {
name : String
value : String
path : String?
expires_raw : String?
max_age : Int64?
domain : String?
secure : Bool
http_only : Bool
extensions : Array[String]
} derive(
Debug
)

#
Cookie::Cookie

#alias(new, deprecated="`new` is deprecated, use `Cookie` instead")
fn Cookie::Cookie(name : String, value : String, path? : String, expires_raw? : String, max_age? : Int64, domain? : String, secure? : Bool, http_only? : Bool, extensions? : Array[String]) -> Cookie

#
Request

pub(all) struct Request {
meth : RequestMethod
path : String
headers : Map[String, String]
}

#
RequestMethod

pub(all) enum RequestMethod {
Get
Head
Post
Put
Delete
Connect
Options
Trace
Patch
} derive(Compare, Eq, Hash,
Debug
)

#
Response

pub(all) struct Response {
code : Int
reason : String
headers : Map[String, String]
cookies : Array[Cookie]
}

#
Server

pub struct Server {
inner :
Server

}

#
Server::accept

async fn Server::accept(self : Server) -> (ServerConnection, Addr) raise HttpError

#
Server::addr

fn Server::addr(self : Server) -> Addr

#
Server::close

fn Server::close(self : Server) -> Unit

#
Server::close_graceful

async fn Server::close_graceful(self : Server, timeout_ms? : Int) -> Unit raise HttpError

#
Server::new

async fn Server::new(host? : String, port? : Int, headers? : Map[String, String], dual_stack? : Bool, reuse_addr? : Bool, max_request_body_bytes? : Int, request_timeout_ms? : Int, keep_alive_timeout_ms? : Int, headers_timeout_ms? : Int, accept_queue_limit? : Int, trust_proxy? : Bool) -> Server raise HttpError

#
Server::port

fn Server::port(self : Server) -> Int

#
Server::run_forever

async fn Server::run_forever(self : Server, f : async (Request, &
Reader
, ServerConnection) -> Unit, allow_failure? : Bool, max_connections? : Int) -> Unit raise HttpError

#
ServerConnection

pub struct ServerConnection {
inner :
ServerConnection

}

#
ServerConnection::client_addr

fn ServerConnection::client_addr(self : ServerConnection) -> Addr

#
ServerConnection::close

fn ServerConnection::close(self : ServerConnection) -> Unit

#
ServerConnection::end_response

async fn ServerConnection::end_response(self : ServerConnection) -> Unit raise HttpError

#
ServerConnection::enter_passthrough_mode

async fn ServerConnection::enter_passthrough_mode(self : ServerConnection) -> Unit raise HttpError

#
ServerConnection::flush

async fn ServerConnection::flush(self : ServerConnection) -> Unit raise HttpError

#
ServerConnection::read_request

async fn ServerConnection::read_request(self : ServerConnection) -> Request raise HttpError

#
ServerConnection::send_response

async fn ServerConnection::send_response(self : ServerConnection, code : Int, reason : String, extra_headers? : Map[String, String], cookies? : Array[Cookie]) -> Unit raise HttpError

#
ServerConnection::skip_request_body

async fn ServerConnection::skip_request_body(self : ServerConnection) -> Unit raise HttpError

#
Stream

pub struct Stream {
inner :
Client

}

#
Stream::close

fn Stream::close(self : Stream) -> Unit

#
Stream::read_all

async fn Stream::read_all(self : Stream) -> Bytes raise HttpError

#
Stream::read_some

async fn Stream::read_some(self : Stream) -> Bytes? raise HttpError

#
get

async fn get(url : String, headers? : Map[String, String], body? : &
Data
, proxy? : Client) -> (Response, &
Data
) raise HttpError

#
get_stream

async fn get_stream(url : String, headers? : Map[String, String], body? : &
Data
, proxy? : Client) -> (Response, Client) raise HttpError

#
post

async fn post(url : String, body : &
Data
, headers? : Map[String, String], proxy? : Client) -> (Response, &
Data
) raise HttpError

#
post_stream

async fn post_stream(url : String, headers? : Map[String, String], proxy? : Client) -> Client raise HttpError

#
put

async fn put(url : String, body : &
Data
, headers? : Map[String, String], proxy? : Client) -> (Response, &
Data
) raise HttpError

#
put_stream

async fn put_stream(url : String, headers? : Map[String, String], proxy? : Client) -> Client raise HttpError

Powered by MoonBit

Site sourceReport issuePackagesBuild queueSkillsStatistics

© 2026 mooncakes.io