macro_rules! use_fetch {
($api:expr, $method:ident) => { ... };
}
Expand description
/// use_fetch it's a fetch api macro
/// to use it add
/// 1 - reqwest
/// 2 - tokio
/// 3 - serde
/// 4 - serde_json
/// at Cargo.toml
/// usage
/// the macro take two values
use_fetch!("api",HTTP_Request);
/// example
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
use_fetch!("https://fakestoreapi.com/products/", GET);
Ok(())
}