Appends a value to an existing response header instead of overwriting it.
Useful for headers that support multiple values (e.g. Vary, Link,
Set-Cookie). Unlike setHeader, this adds the value alongside
any existing ones rather than replacing them.
The header name.
The header value to append.
Builds and returns the final Web API Response object from all
configured headers, status, cookies, and body.
You typically don't need to call this in handler functions — the
HttpRouter class calls it automatically. Use it directly only in
isolation, such as during testing.
The constructed HTTP response.
Checks whether any Set-Cookie headers are present, or whether a
header with the given name exists when one is provided.
Optionalname: stringOptional. The name of the cookie to check. When omitted,
returns true if at least one Set-Cookie header exists.
true if a matching or any Set-Cookie header is present.
Adds a Set-Cookie header if one does not exist, or updates it
if a header with the given name is already present.
The name of the cookie.
The cookie value.
Optionalsettings: CookieSetSettingsOptional cookie attributes (expires, httpOnly, etc.).
This instance for chaining.
Adds or updates a Set-Cookie header with Max-Age=0 for the given name,
expiring the cookie when the response is sent.
If a Set-Cookie header with the given name already exists, it is
replaced with an expired version. Otherwise an expired header is
appended to ensure the client removes any matching cookie.
The name of the cookie to expire.
Optionalsettings: CookieScopeOptional scope attributes (path, secure, domain) to match the cookie that was originally set.
This instance for chaining.
Sets the response body as raw bytes without overriding the Content-Type header.
Accepts a string, binary buffer, or an async iterable of byte chunks for streaming.
Useful when the caller wants full control over the Content-Type header.
The response body content.
Sets the Cache-Control header with caching directives.
Sets the Content-Disposition header (inline or attachment).
Sets the Content-Encoding header (e.g. gzip, br, deflate).
Sets the Content-Language header to a BCP 47 language tag.
Sets the Content-Type header to a well-known media type.
Sets the ETag header for conditional response caching.
Sets an arbitrary response header by key and value.
Useful for headers that don't have a dedicated setter method, such as custom headers or less common standard headers.
The header name (e.g. "X-Custom-Header").
The header value.
Sets the HTTP response status code or well-known HttpStatus.
Strips all Set-Cookie headers from the response builder, or only
the header matching the given name when one is provided.
Optionalname: stringOptional. The name of the cookie to strip. When omitted,
all Set-Cookie headers are removed.
This instance for chaining.
Represents an outgoing HTTP response with a builder-style API.
Each setter returns the instance for chaining. Call buildWebRes to obtain the final Web API
Responseobject.IMPORT_PATH:
"@daiso-tech/core/http-router/contracts"