macro_rules! patch {
($input:ident, $req_body_ty:ident, $url:literal, &mut $client:ident) => { ... };
($input:ident, $req_body_ty:ident, $url:expr, &mut $client:ident) => { ... };
($input:ident, $req_body_ty:ident, $url:expr, &mut $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 the request.req_body_ty- The body serialization type of the request.url- The URL to make the PATCH request to.client- The client variable to use for the request.
Please note url can be a string literal or a variable.
§Example
ⓘ
let mut client = Deboa::new();
let response = patch!(data, JsonBody, "https://jsonplaceholder.typicode.com/posts/1", &mut client);
assert_eq!(response.id, 1);