stdlib/httpsView source ↗
https
14 items · generated by scribe fromstdlib/https.fd· synced 2026-11-15
Contents
- FetchResult (struct)
- fetch_with (function)
- fetch (function)
- fetch_post (function)
- https_serve_scoped (function)
- https_serve (function)
FetchResult
What a request gave. status is 0 when it never got an answer, and error says why.
pub struct FetchResult {Fields:
| Name | Type |
|---|---|
status | i64 |
message | HttpRequest |
body | str |
error | str |
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:strurl:strheaders:strbody: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:strcontent_type:strbody: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:i64cert:strkey:strhandler: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:i64cert:strkey:strhandler:fn(HttpRequest) -> str
Returns: bool
Defined at line 171
Generated by scribe, the Fides documentation generator