pub struct HttpTransport { /* private fields */ }Available on crate feature
http only.Expand description
HTTP-based MCP transport for communicating with HTTP servers.
Implementations§
Source§impl HttpTransport
impl HttpTransport
Sourcepub fn with_timeout(
endpoint: impl Into<String>,
timeout: Duration,
) -> Result<Self, McpTransportError>
pub fn with_timeout( endpoint: impl Into<String>, timeout: Duration, ) -> Result<Self, McpTransportError>
Create with custom timeout.
Sourcepub async fn send_request(
&self,
method: &str,
params: Option<Value>,
) -> Result<Value, McpTransportError>
pub async fn send_request( &self, method: &str, params: Option<Value>, ) -> Result<Value, McpTransportError>
Send a JSON-RPC request via HTTP POST.
Sourcepub async fn health_check(&self) -> bool
pub async fn health_check(&self) -> bool
Health check - verify the endpoint is reachable.
Auto Trait Implementations§
impl Freeze for HttpTransport
impl !RefUnwindSafe for HttpTransport
impl Send for HttpTransport
impl Sync for HttpTransport
impl Unpin for HttpTransport
impl !UnwindSafe for HttpTransport
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more