diff --git a/src/agent/namespaces/http/mod.rs b/src/agent/namespaces/http/mod.rs index 875cd1b..46966b3 100644 --- a/src/agent/namespaces/http/mod.rs +++ b/src/agent/namespaces/http/mod.rs @@ -146,6 +146,7 @@ impl Action for Request { let attrs = attrs.unwrap(); let method = reqwest::Method::from_str(attrs.get("method").unwrap())?; let parsed = Self::create_url_from(&state, payload.clone()).await?; + let query_str = parsed.query().unwrap_or("").to_string(); let mut client = reqwest::Client::new().request(method.clone(), parsed.clone()); let lock = state.lock().await; @@ -155,6 +156,13 @@ impl Action for Request { client = client.header(key, &value.data); } + // if there're parameters and we're not in GET, set them as the body + if !query_str.is_empty() { + if !matches!(method, reqwest::Method::GET) { + client = client.body(query_str); + } + } + log::info!( "{}.{} {} ...", "http".bold(),