http

Attribute Macro http 

Source
#[http]
Expand description

Mark a method with a custom HTTP method and path.

This is useful for less common HTTP methods or when you want to specify the method and path in a single attribute.

§Example

#[http("GET /users/{id}")]
pub async fn get_user(&self, #[path] id: u64) -> pincer::Result<User>;

#[http("OPTIONS /users")]
pub async fn user_options(&self) -> pincer::Result<()>;