MCPcopy Index your code
hub / github.com/github/copilot-sdk / performRequest

Method performRequest

test/harness/capturingHttpProxy.ts:146–167  ·  view source on GitHub ↗
(options: PerformRequestOptions)

Source from the content-addressed store, hash-verified

144 }
145
146 performRequest(options: PerformRequestOptions): void {
147 const protocol = options.isHttps ? https : http;
148 const upstreamRequest = protocol.request(
149 options.requestOptions,
150 (upstreamResponse) => {
151 options.onResponseStart(
152 upstreamResponse.statusCode || 500,
153 upstreamResponse.headers,
154 );
155 upstreamResponse.on("data", options.onData);
156 upstreamResponse.on("end", options.onResponseEnd);
157 },
158 );
159
160 upstreamRequest.on("error", options.onError);
161
162 if (options.body) {
163 upstreamRequest.write(options.body);
164 }
165
166 upstreamRequest.end();
167 }
168
169 protected clearExchanges(): void {
170 this.capturedExchanges.length = 0;

Callers 1

startMethod · 0.95

Calls 4

requestMethod · 0.45
onMethod · 0.45
writeMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected