Skip to content

stdlib/httpsView source ↗

https

14 items · generated by scribe fromstdlib/https.fd· synced 2026-11-15

stdlib/https14 items

Contents

FetchResult

What a request gave. status is 0 when it never got an answer, and error says why.

pub struct FetchResult {

Fields:

NameType
statusi64
messageHttpRequest
bodystr
errorstr

Defined at line 20


fetch_with

A request, following redirects. headers are extra headers, each “Name: value\r\n”.

pub fn fetch_with(method: str, url: str, headers: str, body: str) -> FetchResult {

Parameters:

  • method: str
  • url: str
  • headers: str
  • body: str

Returns: FetchResult

Defined at line 132


fetch

GET a URL.

pub fn fetch(url: str) -> FetchResult {

Parameters:

  • url: str

Returns: FetchResult

Defined at line 153


fetch_post

POST a body to a URL.

pub fn fetch_post(url: str, content_type: str, body: str) -> FetchResult {

Parameters:

  • url: str
  • content_type: str
  • body: str

Returns: FetchResult

Defined at line 158


https_serve_scoped

As https_serve, with memory that stays flat: the handler borrows each request, as with http_serve_scoped.

pub fn https_serve_scoped(port: i64, cert: str, key: str, handler: fn(ScopedRequest) -> str) -> bool {

Parameters:

  • port: i64
  • cert: str
  • key: str
  • handler: fn(ScopedRequest) -> str

Returns: bool

Defined at line 164


https_serve

Serve HTTPS on port until the process ends: cert and key are as for tls_server. Returns false if the port or the certificate cannot be opened.

pub fn https_serve(port: i64, cert: str, key: str, handler: fn(HttpRequest) -> str) -> bool {

Parameters:

  • port: i64
  • cert: str
  • key: str
  • handler: fn(HttpRequest) -> str

Returns: bool

Defined at line 171


Generated by scribe, the Fides documentation generator