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

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

Fast, minimalist web framework for Deno ported from ExpressJS.
Very Popular
Go to Latest
method Response.prototype.set
import { Response } from "https://deno.land/x/opine@2.2.0/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>