( body: UrlParams.Input, options?: Options.WithContentType | undefined )
| 373 | * @since 4.0.0 |
| 374 | */ |
| 375 | export 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. |
nothing calls this directly
no test coverage detected