Skip to main content
Module

x/drash/mod.ts>Request#accepts

A microframework for Deno's HTTP server with zero third-party dependencies
Go to Latest
method Request.prototype.accepts
import { Request } from "https://deno.land/x/drash@v2.7.0/mod.ts";

Check if the content type in question are accepted by the request.

Parameters

contentType: string
  • A proper MIME type. See /src/dictionaries/mime_db.ts for proper MIME types that Drash can handle.

Returns

boolean

True if yes, false if no.