MCPcopy
hub / github.com/ecyrbe/zodios / post

Method post

src/zodios.ts:318–334  ·  view source on GitHub ↗

* make a post request to the api * @param path - the path to api endpoint * @param data - the data to send * @param config - the config to setup axios options and parameters * @returns response validated with zod schema provided in the api description

(
    path: Path,
    data: ReadonlyDeep<UndefinedIfNever<ZodiosBodyByPath<Api, "post", Path>>>,
    ...[config]: RequiredKeys<TConfig> extends never
      ? [config?: ReadonlyDeep<TConfig>]
      : [config: ReadonlyDeep<TConfig>]
  )

Source from the content-addressed store, hash-verified

316 * @returns response validated with zod schema provided in the api description
317 */
318 async post<
319 Path extends ZodiosPathsByMethod<Api, "post">,
320 TConfig extends ZodiosRequestOptionsByPath<Api, "post", Path>
321 >(
322 path: Path,
323 data: ReadonlyDeep<UndefinedIfNever<ZodiosBodyByPath<Api, "post", Path>>>,
324 ...[config]: RequiredKeys<TConfig> extends never
325 ? [config?: ReadonlyDeep<TConfig>]
326 : [config: ReadonlyDeep<TConfig>]
327 ): Promise<ZodiosResponseByPath<Api, "post", Path>> {
328 return this.request({
329 ...config,
330 method: "post",
331 url: path,
332 data,
333 } as any);
334 }
335
336 /**
337 * make a put request to the api

Callers 2

api.test.tsFile · 0.80
zodios.test.tsFile · 0.80

Calls 1

requestMethod · 0.95

Tested by

no test coverage detected