delete

Attribute Macro delete 

Source
#[delete]
Expand description

A procedural macro for building an HTTP DELETE 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)

DELETE 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:

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