method WebClient.prototype.post
WebClient.prototype.post(
path: string,
body: unknown,
options?: RequestOptions,
): Task<ResponseResult, HttpError>

Make a POST request with a body.

Examples

Example 1

const result = await client.post("/users", { name: "John" }).run();

Parameters

path: string
  • The request path, relative to baseUrl if configured.
body: unknown
  • The request body (serialized as JSON).
optional
options: RequestOptions
  • Request-specific options.

Return Type

A Task that resolves with the response or rejects with an HttpError.

Usage

import { WebClient } from ".";