Skip to main content

Function: post()

Issue an HTTP POST with a JSON body (or text/form when overridden via options.bodyType). Convenience wrapper around fetcher.

Example

const created = yield* post<User>("/api/users", { name: "Alice" });

Call Signature

post<T>(url, body?, options?, params?): Effect<T, FetcherValidationError | FetcherError, HttpClient>
Defined in: packages/http/src/fetcher.ts:607

Type Parameters

T

T = unknown

Parameters

url

string

body?

any

options?

FetcherOptions<T>

params?

Returns

Effect<T, FetcherValidationError | FetcherError, HttpClient>

Call Signature

post<S>(url, body, options, params?): Effect<Type<S>, FetcherValidationError | FetcherError, HttpClient>
Defined in: packages/http/src/fetcher.ts:614

Type Parameters

S

S extends SyncSchema<Type<S>>

Parameters

url

string

body

any

options

FetcherOptions<Type<S>> & object

params?

Returns

Effect<Type<S>, FetcherValidationError | FetcherError, HttpClient>