Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Model HttpClient

http/client::HttpClient


Parameters

↳ const base_url: Option<string> = _
↳ const headers: StringMap (std/data/string_map::StringMap)
↳ const secret_headers: Option<Map> = _ (std/data/map::Map)
↳ const tcp_no_delay: bool = true


HTTP client for general use

The HTTP client provides configuration for HTTP requests.

  • base_url: The base URL for a client. All request URLs will be relative to this URL.
  • tcp_no_delay: TCP NO_DELAY field.
  • headers: Headers to add in requests made with this client.
  • secret_headers: Headers to add in requests made with this client, whose values are Secret<string> (or Option<Secret<string>>, as given by std/secret::|locate), such as Authorization. They are revealed by the treatment making each request.

The default headers are Accept: */* and User-Agent: http-mel/<version>