MCPcopy Index your code
hub / github.com/Effect-TS/effect / json

Function json

packages/platform/src/internal/httpBody.ts:121–125  ·  view source on GitHub ↗
(body: unknown, contentType?: string)

Source from the content-addressed store, hash-verified

119
120/** @internal */
121export const json = (body: unknown, contentType?: string): Effect.Effect<Body.Uint8Array, Body.HttpBodyError> =>
122 Effect.try({
123 try: () => unsafeJson(body, contentType),
124 catch: (error) => HttpBodyError({ _tag: "JsonError", error })
125 })
126
127/** @internal */
128export const urlParams = (urlParams: UrlParams.UrlParams, contentType?: string): Body.Uint8Array =>

Callers 1

jsonSchemaFunction · 0.70

Calls 2

unsafeJsonFunction · 0.70
HttpBodyErrorFunction · 0.70

Tested by

no test coverage detected