MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / postJson

Function postJson

e2e/scenarios/custom-tools.test.ts:179–195  ·  view source on GitHub ↗
(
  target: TargetShape,
  identity: Identity,
  path: string,
  body?: unknown,
  expectedStatus = 200,
)

Source from the content-addressed store, hash-verified

177};
178
179const postJson = <T>(
180 target: TargetShape,
181 identity: Identity,
182 path: string,
183 body?: unknown,
184 expectedStatus = 200,
185): Promise<{ readonly body: T; readonly text: string }> =>
186 request<T>(
187 target,
188 identity,
189 path,
190 {
191 method: "POST",
192 ...(body !== undefined ? { body: JSON.stringify(body) } : {}),
193 },
194 expectedStatus,
195 );
196
197const deletePath = (
198 target: TargetShape,

Callers 1

executeFunction · 0.70

Calls 1

requestFunction · 0.70

Tested by

no test coverage detected