Macro anterofit::force_body[][src]

macro_rules! force_body {
    ($expr:expr) => { ... };
}

Allows the inside expression to set a body on a request which doesn't regularly take one.


service! {
    pub trait ForcedBodyService {
        fn get_with_fields(&self) -> String {
            // `GET` requests are not regularly allowed to take bodies;
            // this is checked at compile time.
            GET("/foo");
            force_body! {
                fields! {
                    "Hello" => "World"
                }
            }
        }
    }
}