header

Attribute Macro header 

Source
#[header]
Expand description

A procedural macro for adding HTTP headers to a request. It includes the following attributes:

  • name - HTTP header name (String)
  • value - HTTP header value (String)
  • sensitive - sensitive HTTP header value (true/false)

It also supports filling #[placeholder] into header values.

Examples:

#[header(name = "Content-Type", value = "application/json")]
#[header(name = "Authorization", value = "Bearer {token}", sensitive = true)]
#[get(path = "/", consumes = "application/json", produces = "application/json")]
fn get(&self, #[placeholder] token: &str) -> ClientixResult<ClientixResponse<String>>;