macro_rules! make_json_request {
($sel:ident, $method:path, $url:expr, $body:expr, $query:expr, $response_ty:ty) => { ... };
}Expand description
Make a http request by providing a json-body Macro for making a JSON request using the specified HTTP method, URL, and request body.
§Arguments
$sel: The selector for the HTTP client.$method: The HTTP method to use for the request.$url: The URL to send the request to.$body: The request body.$query: Optional query parameters to include in the request.$response_ty: The expected response type.
§Returns
Returns a Result containing the JSON response if the request is successful, or an APIError if the request fails.