/* * This file is part of laurelin_client * Copyright (C) 2023 Jonni Liljamo * * Licensed under GPL-3.0-only. * See LICENSE for licensing information. */ #[macro_export] macro_rules! get_request_auth { ($no:expr, $path:expr) => { $no.req .get(&format!("{}{}", &$no.api_address, &$path)) .header("Authorization", &$no.user_token) .send() .unwrap() }; } #[macro_export] macro_rules! post_request { ($no:expr, $path:expr, $input:expr) => { $no.req .post(&format!("{}{}", &$no.api_address, &$path)) .json($input) .send() .unwrap() }; } #[macro_export] macro_rules! post_request_auth { ($no:expr, $path:expr, $input:expr) => { $no.req .post(&format!("{}{}", &$no.api_address, &$path)) .header("Authorization", &$no.user_token) .json($input) .send() .unwrap() }; }