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

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

Fast, minimalist web framework for Deno ported from ExpressJS.
Very Popular
Go to Latest
method Response.prototype.type
import { Response } from "https://deno.land/x/opine@2.2.0/src/response.ts";

Set Content-Type response header with type.

Examples:

res.type('.html');
res.type('html');
res.type('json');
res.type('application/json');
res.type('png');

Parameters

type: string

Returns

this

for chaining