(body: unknown, contentType?: string)
| 358 | * @since 4.0.0 |
| 359 | */ |
| 360 | export const json = (body: unknown, contentType?: string): Effect.Effect<Uint8Array, HttpBodyError> => |
| 361 | Effect.try({ |
| 362 | try: () => text(JSON.stringify(body), contentType ?? "application/json"), |
| 363 | catch: (cause) => new HttpBodyError({ reason: { _tag: "JsonError" }, cause }) |
| 364 | }) |
| 365 | |
| 366 | /** |
| 367 | * Creates a JSON body constructor that first encodes values with the schema's JSON codec. |
no test coverage detected