MCPcopy Create free account
hub / github.com/compiler-explorer/compiler-explorer / fetchFromAPI

Method fetchFromAPI

static/panes/explain-view.ts:438–450  ·  view source on GitHub ↗
(payload: ExplainRequest)

Source from the content-addressed store, hash-verified

436 }
437
438 private async fetchFromAPI(payload: ExplainRequest): Promise<ClaudeExplainResponse> {
439 const response = await window.fetch(this.explainApiEndpoint, {
440 method: 'POST',
441 headers: {'Content-Type': 'application/json'},
442 body: JSON.stringify(payload),
443 });
444
445 if (!response.ok) {
446 throw new Error(`Server returned ${response.status} ${response.statusText}`);
447 }
448
449 return response.json() as Promise<ClaudeExplainResponse>;
450 }
451
452 private getExplainContext(): ExplainContext {
453 return {

Callers 1

fetchExplanationMethod · 0.95

Calls 1

jsonMethod · 0.80

Tested by

no test coverage detected