api

client.ch

Declarations in client.ch

2 declarationshttp

Declarations

Public only
http#
Publicnamespace
namespace http
===== HTTP Client =====
URL#
Publicstruct
struct URL { var scheme : string var host : string var port : uint var path : string var query : string }
constructor#
PublicfunctionConstructor
func constructor() : URL
parse#
Publicfunction
func parse(url_str : &string_view) : Option<URL>
delete#
function
func delete(self : *URL) : void
RequestBuilder#
Publicstruct
struct RequestBuilder { var method : string var url : URL var headers : HeaderMap var body : string var timeout_secs : long }
constructor#
PublicfunctionConstructor
func constructor(m : *char, u : URL) : RequestBuilder
header_view#
Publicfunction
func header_view(self : &RequestBuilder, k : &string_view, v : &string_view) : &RequestBuilder
query#
Publicfunction
func query(self : &RequestBuilder, k : string_view, v : string_view) : &RequestBuilder
set_body#
Publicfunction
func set_body(self : &RequestBuilder, b : &string_view, content_type : *char) : &RequestBuilder
timeout#
Publicfunction
func timeout(self : &RequestBuilder, secs : long) : &RequestBuilder
basic_auth#
Publicfunction
func basic_auth(self : &RequestBuilder, user : *char, pass : *char) : &RequestBuilder
build#
Publicfunction
func build(self : &RequestBuilder, absolute : bool) : string
make#
functionConstructor
func make() : RequestBuilder
delete#
function
func delete(self : *RequestBuilder) : void
http#
Publicnamespace
namespace http
Client#
Publicstruct
struct Client { var default_timeout_secs : long var max_response_header_bytes : usize var max_body_len : usize var ca_chain : *X509Cert var tls_skip_verify : bool var proxy_host : string var proxy_port : uint }
constructor#
PublicfunctionConstructor
func constructor() : Client
set_ca_chain#
Publicfunction
func set_ca_chain(self : &Client, ca : *X509Cert) : &Client
Use a specific CA certificate (chain) for HTTPS server verification
insecure_skip_verify#
Publicfunction
func insecure_skip_verify(self : &Client, skip : bool) : &Client
Disable TLS certificate and hostname verification (insecure mode).
set_proxy#
Publicfunction
func set_proxy(self : &Client, host : &string_view, port : uint) : &Client
Route requests through an HTTP proxy (host:port). HTTPS targets use
request#
Publicfunction
func request(self : &Client, req_builder : &RequestBuilder) : Result<Response, string>
get#
Publicfunction
func get(self : &Client, url_str : &string_view) : Result<Response, string>
post#
Publicfunction
func post(self : &Client, url_str : &string_view, body : &string_view, content_type : *char) : Result<Response, string>
put#
Publicfunction
func put(self : &Client, url_str : &string_view, body : &string_view, content_type : *char) : Result<Response, string>
patch#
Publicfunction
func patch(self : &Client, url_str : &string_view, body : &string_view, content_type : *char) : Result<Response, string>
delete#
Publicfunction
func delete(self : &Client, url_str : &string_view) : Result<Response, string>