MCPcopy Index your code
hub / github.com/anomalyco/opencode / toRequest

Function toRequest

packages/opencode/test/server/httpapi-exercise/backend.ts:80–87  ·  view source on GitHub ↗
(scenario: ActiveScenario, ctx: SeededContext<unknown>)

Source from the content-addressed store, hash-verified

78}
79
80function toRequest(scenario: ActiveScenario, ctx: SeededContext<unknown>) {
81 const spec = scenario.request(ctx, ctx.state)
82 return new Request(new URL(spec.path, "http://localhost"), {
83 method: scenario.method,
84 headers: spec.body === undefined ? spec.headers : { "content-type": "application/json", ...spec.headers },
85 body: spec.body === undefined ? undefined : JSON.stringify(spec.body),
86 })
87}
88
89function toAuthProbeRequest(scenario: ActiveScenario, credentials: "missing" | "valid", signal: AbortSignal) {
90 const spec = scenario.authProbe ?? {

Callers 1

callFunction · 0.85

Calls 1

requestMethod · 0.45

Tested by

no test coverage detected