macro_rules! patch {
($input:ident, $url:literal, &$client:ident) => { ... };
($input:ident, $url:expr, $headers:expr, &$client:ident) => { ... };
($input:ident, $req_body_ty:ident, $url:literal, &$client:ident) => { ... };
($input:ident, $req_body_ty:ident, $url:expr, &$client:ident) => { ... };
($input:ident, $req_body_ty:ident, $url:literal, $headers:expr, &$client:ident) => { ... };
($input:ident, $req_body_ty:ident, $url:expr, $headers:expr, &$client:ident) => { ... };
($input:ident, $req_body_ty:ident, $url:expr, &$client:ident, $res_body_ty:ident, $res_ty:ty) => { ... };
($input:ident, $req_body_ty:ident, $url:expr, $headers:expr, &$client:ident, $res_body_ty:ident, $res_ty:ty) => { ... };
}Expand description
Make a PATCH request to the specified URL.
The patch! macro is used to make a PATCH request to the specified URL
Its first argument is a string literal or a variable.
To help understand the macro arguments, here is an example:
patch!(input, req_body_ty, url, &mut client)
§Arguments
input- The input to send with request.req_body_ty- The body serialization format of request.url- The URL to make the PATCH request to.headers- The headers to send with request.client- The client variable to use for request.
Please note url can be a string literal or a variable.
§Example
ⓘ
let client = Client::new();
let response = patch!(data, JsonBody, "https://jsonplaceholder.typicode.com/posts/1", &client);
assert_eq!(response.id, 1);