MCPcopy Create free account
hub / github.com/Effect-TS/effect / urlParams

Function urlParams

packages/effect/src/unstable/http/HttpServerResponse.ts:375–390  ·  view source on GitHub ↗
(
  body: UrlParams.Input,
  options?: Options.WithContentType | undefined
)

Source from the content-addressed store, hash-verified

373 * @since 4.0.0
374 */
375export const urlParams = (
376 body: UrlParams.Input,
377 options?: Options.WithContentType | undefined
378): HttpServerResponse => {
379 const headers = options?.headers ? Headers.fromInput(options.headers) : Headers.empty
380 return makeResponse({
381 status: options?.status ?? 200,
382 statusText: options?.statusText,
383 headers,
384 cookies: options?.cookies,
385 body: Body.text(
386 UrlParams.toString(UrlParams.fromInput(body)),
387 getContentType(options, headers) ?? "application/x-www-form-urlencoded"
388 )
389 })
390}
391
392/**
393 * Creates a response with a raw body value.

Callers

nothing calls this directly

Calls 4

getContentTypeFunction · 0.85
makeResponseFunction · 0.70
toStringMethod · 0.65
textMethod · 0.45

Tested by

no test coverage detected