@@ 8,6 8,8 @@
mod async_task;
+mod request;
+
/*
use crate::{async_task_start_call, async_task_handle_call};
@@ 0,0 1,41 @@
+/*
+ * This file is part of laurelin_client
+ * Copyright (C) 2023 Jonni Liljamo <jonni@liljamo.com>
+ *
+ * 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
+ .get(&format!("{}{}", &$no.api_address, &$path))
+ .json($input)
+ .send()
+ .unwrap()
+ };
+}
+
+#[macro_export]
+macro_rules! post_request_auth {
+ ($no:expr, $path:expr, $input:expr) => {
+ $no.req
+ .get(&format!("{}{}", &$no.api_address, &$path))
+ .header("Authorization", &$no.user_token)
+ .json($input)
+ .send()
+ .unwrap()
+ };
+}