pub async fn post(
        &self,
        path: &str,
        body: &str,
    ) -> Result<SwanlingResponse, SwanlingTaskError> {
        let request_builder = self.swanling_post(path).await?.body(body.to_string());

        Ok(self.swanling_send(request_builder, None).await?)
    }
/// A helper to make a `POST` request of a path and collect relevant metrics.
/// Automatically prepends the correct host.
///
/// (If you need to set headers, change timeouts, or otherwise make use of the
/// [`reqwest::RequestBuilder`](https://docs.rs/reqwest/*/reqwest/struct.RequestBuilder.html)
/// object, you can instead call `swanling_post` which returns a
/// [`RequestBuilder`](https://docs.rs/reqwest/*/reqwest/struct.RequestBuilder.html),
/// then call `swanling_send` to invoke the request.)
///
/// Calls to `post()` return a [`SwanlingResponse`](./struct.SwanlingResponse.html) object which
/// contains a copy of the request you made ([`SwanlingRequestMetric`](./struct.SwanlingRequestMetric.html)),
/// and the response ([`reqwest::Response`](https://docs.rs/reqwest/*/reqwest/struct.Response.html)).
///
/// # Example
/// ```rust
/// use swanling::prelude::*;
///
/// let mut task = task!(post_function);
///
/// /// A very simple task that makes a POST request.
/// async fn post_function(user: &SwanlingUser) -> SwanlingTaskResult {
///     let _swanling = user.post("/path/to/foo/", "BODY BEING POSTED").await?;
///
///     Ok(())
/// }
/// ```
A helper to make a `POST` request of a path and collect relevant metrics.
Automatically prepends the correct host.




A helper to make a ` POST ` request of a path and collect relevant metrics . Automatically prepends the correct host .
pub async fn post(
        &self,
        path: &str,
        body: &str,
    ) -> Result<SwanlingResponse, SwanlingTaskError> {
        let request_builder = self.swanling_post(path).await?.body(body.to_string());
        Ok(self.swanling_send(request_builder, None).await?)
    }
pub async fn post ( & self , path : & str , body : & str , ) -> Result < SwanlingResponse , SwanlingTaskError > { let request_builder = self . swanling_post ( path ) . await ? . body ( body . to_string ( ) ) ; Ok ( self . swanling_send ( request_builder , None ) . await ? ) }
A helper to make a `POST` request of a path and collect relevant metrics.
A helper to make a ` POST ` request of a path and collect relevant metrics .
&self
path
&str
body
&str
example
```rust
use swanling::prelude::*.

let mut task = task!(post_function).

A very simple task that makes a POST request.
async fn post_function(user: &SwanlingUser) -> SwanlingTaskResult {
let _swanling = user.post("/path/to/foo/", "BODY BEING POSTED").await?.


` ` ` rust use swanling :: prelude :: * . let mut task = task! ( post_function ) . A very simple task that makes a POST request . async fn post_function ( user : &SwanlingUser ) - > SwanlingTaskResult { let _swanling = user . post ( " / path / to / foo / " " BODY BEING POSTED " ) . await? .