Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/opine/src/response.ts>Response#set

Minimalist web framework for Deno ported from ExpressJS.
Latest
method Response.prototype.set
import { Response } from "https://deno.land/x/opine@2.3.4/src/response.ts";

Set header field to value, or pass an object of header fields.

Examples:

res.set('Accept', 'application/json');
res.set({
  'Accept-Language': 'en-US, en;q=0.5',
  'Accept': 'text/html',
});

Parameters

field: string
value: string

Returns

this

for chaining

Parameters

obj: Record<string, string>