MCPcopy Create free account
hub / github.com/mswjs/interceptors / httpsGet

Function httpsGet

test/helpers.ts:37–57  ·  view source on GitHub ↗
(
  url: string,
  options?: RequestOptions
)

Source from the content-addressed store, hash-verified

35}
36
37export function httpsGet(
38 url: string,
39 options?: RequestOptions
40): Promise<PromisifiedResponse> {
41 const parsedUrl = new URL(url)
42 const resolvedOptions = Object.assign(
43 {},
44 urlToHttpOptions(parsedUrl),
45 options
46 )
47
48 return new Promise((resolve, reject) => {
49 const req = https.get(resolvedOptions, async (res) => {
50 res.setEncoding('utf8')
51 const resBody = await getIncomingMessageBody(res)
52 resolve({ req, res, resBody, url, options: resolvedOptions })
53 })
54
55 req.on('error', reject)
56 })
57}
58
59export function httpRequest(
60 url: string,

Callers 1

miniflare.test.tsFile · 0.90

Calls 3

getIncomingMessageBodyFunction · 0.90
getMethod · 0.80
onMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…