MCPcopy Index your code
hub / github.com/ChrisFeldmeier/OpenCodeRust / fetch_url

Function fetch_url

crates/opencode-session/src/instruction.rs:550–560  ·  view source on GitHub ↗
(url: &str)

Source from the content-addressed store, hash-verified

548// ---------------------------------------------------------------------------
549
550async fn fetch_url(url: &str) -> Result<String, reqwest::Error> {
551 let client = reqwest::Client::builder()
552 .timeout(std::time::Duration::from_secs(5))
553 .build()?;
554 let resp = client.get(url).send().await?;
555 if resp.status().is_success() {
556 resp.text().await
557 } else {
558 Ok(String::new())
559 }
560}
561
562// ---------------------------------------------------------------------------
563// Tests

Callers 1

Calls 6

newFunction · 0.85
buildMethod · 0.80
sendMethod · 0.45
getMethod · 0.45
statusMethod · 0.45
textMethod · 0.45

Tested by

no test coverage detected