MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / post

Method post

packages/telemetry/src/transport.ts:190–211  ·  view source on GitHub ↗
(
    payload: TelemetryPayload,
    headers: Record<string, string>,
    signal?: AbortSignal,
  )

Source from the content-addressed store, hash-verified

188 }
189
190 private async post(
191 payload: TelemetryPayload,
192 headers: Record<string, string>,
193 signal?: AbortSignal,
194 ): Promise<Response> {
195 try {
196 return await fetchWithTimeout(
197 this.fetchImpl,
198 this.endpoint,
199 {
200 method: 'POST',
201 headers: { ...headers },
202 body: JSON.stringify(payload),
203 },
204 this.requestTimeoutMs,
205 signal,
206 );
207 } catch (error) {
208 if (signal?.aborted === true || isAbortError(error)) throw error;
209 throw new TransientTelemetryError(String(error));
210 }
211 }
212
213 private telemetryDir(): string {
214 const path = join(this.homeDir, 'telemetry');

Callers 1

sendHttpMethod · 0.95

Calls 2

fetchWithTimeoutFunction · 0.70
isAbortErrorFunction · 0.70

Tested by

no test coverage detected