Skip to main content

HttpPoster

Trait HttpPoster 

Source
pub trait HttpPoster: Send + Sync {
    // Required method
    fn post<'life0, 'async_trait>(
        &'life0 self,
        request: HttpRequest,
    ) -> Pin<Box<dyn Future<Output = Result<HttpReply>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Available on crate feature mcp only.
Expand description

Abstraction over the act of POSTing one JSON-RPC message to the MCP endpoint.

Production uses ReqwestPoster; tests inject a scripted poster so the JSON / SSE decode paths run with zero live network.

Required Methods§

Source

fn post<'life0, 'async_trait>( &'life0 self, request: HttpRequest, ) -> Pin<Box<dyn Future<Output = Result<HttpReply>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

POST request to the MCP endpoint and return the normalised reply.

§Errors

Returns an error if the HTTP request fails or the server returns a non-success status.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§