Create a client that communicates over StreamableHTTP.
(
server_name: String,
tool_registry: Arc<McpToolRegistry>,
url: String,
headers: Option<HashMap<String, String>>,
)
| 195 | } |
| 196 | /// Create a client that communicates over StreamableHTTP. |
| 197 | pub async fn http( |
| 198 | server_name: String, |
| 199 | tool_registry: Arc<McpToolRegistry>, |
| 200 | url: String, |
| 201 | headers: Option<HashMap<String, String>>, |
| 202 | ) -> Result<Self, McpClientError> { |
| 203 | let client = Self::new(server_name, tool_registry); |
| 204 | client.connect_http(url, headers).await?; |
| 205 | Ok(client) |
| 206 | } |
| 207 | |
| 208 | /// Create a client that communicates over SSE. |
| 209 | pub async fn sse( |
nothing calls this directly
no test coverage detected