MCPcopy Create free account
hub / github.com/langgenius/dify / testHttpClient

Function testHttpClient

cli/test/fixtures/http-client.ts:9–14  ·  view source on GitHub ↗
(host: string, bearerOrOpts?: string | ClientOverrides)

Source from the content-addressed store, hash-verified

7// Wraps createHttpClient + openAPIBase for tests so call sites read at a glance.
8// Accepts a bare bearer string for the common case, or an options object for everything else.
9export function testHttpClient(host: string, bearerOrOpts?: string | ClientOverrides): HttpClient {
10 const opts: ClientOverrides = typeof bearerOrOpts === 'string'
11 ? { bearer: bearerOrOpts }
12 : (bearerOrOpts ?? {})
13 return createHttpClient({ baseURL: openAPIBase(host), ...opts })
14}

Callers 15

httpFunction · 0.90
httpFunction · 0.90
devices.test.tsFile · 0.90
login.test.tsFile · 0.90
httpFunction · 0.90
renderFunction · 0.90
run.test.tsFile · 0.90
httpFunction · 0.90
run.test.tsFile · 0.90
makeApiFunction · 0.90
app-run.test.tsFile · 0.90

Calls 2

createHttpClientFunction · 0.90
openAPIBaseFunction · 0.85

Tested by 13

httpFunction · 0.72
httpFunction · 0.72
httpFunction · 0.72
renderFunction · 0.72
httpFunction · 0.72
makeApiFunction · 0.72
makeClientFunction · 0.72
makeClientFunction · 0.72
makeClientFunction · 0.72
makeClientFunction · 0.72
makeClientFunction · 0.72
makeClientFunction · 0.72