MCPcopy Create free account
hub / github.com/ChrisFeldmeier/OpenCodeRust / fetch

Method fetch

crates/opencode-server/src/server.rs:39–59  ·  view source on GitHub ↗
(
        &self,
        request: CustomFetchRequest,
    )

Source from the content-addressed store, hash-verified

37#[async_trait]
38impl CustomFetchProxy for PluginBridgeFetchProxy {
39 async fn fetch(
40 &self,
41 request: CustomFetchRequest,
42 ) -> Result<CustomFetchResponse, ProviderError> {
43 let response = self
44 .bridge
45 .fetch_proxy(PluginFetchRequest {
46 url: request.url,
47 method: request.method,
48 headers: request.headers,
49 body: request.body,
50 })
51 .await
52 .map_err(|e| ProviderError::NetworkError(e.to_string()))?;
53
54 Ok(CustomFetchResponse {
55 status: response.status,
56 headers: response.headers,
57 body: response.body,
58 })
59 }
60
61 async fn fetch_stream(
62 &self,

Callers

nothing calls this directly

Calls 1

fetch_proxyMethod · 0.80

Tested by

no test coverage detected