head

Attribute Macro head 

Source
#[head]
Expand description

A procedural macro for building an HTTP HEAD method of trait. It includes the following attributes:

  • path - a part of the URL path (String)
  • consumes - content type for request, support: application/json, application/xml, application/x-www-form-urlencoded (String)
  • produces - accept type for response, support: application/json, application/xml, application/x-www-form-urlencoded (String)

HEAD method supports argument macros:

  • #[segment] - maps method arguments to path segments (simple types, String)
  • #[query] - maps method arguments to query parameters (simple types, String)
  • #header - maps method arguments to request headers (simple types, String)
  • #[body] - maps method arguments to request body (object implemented #data_transfer)
  • #[placeholder] - maps method arguments to request header placeholders

Example:

#[head(path = "/{path_query}", consumes = "application/json", produces = "application/json")]
fn head(&self, #[segment] path_query: &str, #[query] query_param: &str) -> ClientixResult<ClientixResponse<String>>;