MCPcopy
hub / github.com/eggjs/egg / request

Method request

test/fixtures/apps/httpclient-overwrite/app.js:7–14  ·  view source on GitHub ↗
(url, opt)

Source from the content-addressed store, hash-verified

5module.exports = app => {
6 class CustomHttpClient extends app.HttpClient {
7 request(url, opt) {
8 return new Promise(resolve => {
9 assert(/^http/.test(url), 'url should start with http, but got ' + url);
10 resolve();
11 }).then(() => {
12 return super.request(url, opt);
13 });
14 }
15
16 curl(url, opt) {
17 return this.request(url, opt);

Callers 14

curlMethod · 0.95
app_worker.test.tsFile · 0.45
httpclient.test.tsFile · 0.45
multipart.test.tsFile · 0.45
request.test.tsFile · 0.45
requestWithHttpclientMethod · 0.45
httpclientMethod · 0.45
app.jsFile · 0.45
framework.tsFile · 0.45

Calls 1

testMethod · 0.65

Tested by

no test coverage detected