Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/oak_commons/media_types.ts>MediaType

A set of APIs for handling HTTP and HTTPS requests with Deno 🐿️ 🦕
Very Popular
Go to Latest
class MediaType
import { MediaType } from "https://deno.land/x/oak_commons@0.6.1/media_types.ts";

A class which encapsulates the information in a media type, allowing inspecting of modifying individual parts of the media type.

Constructors

new
MediaType(
type: string,
subtype: string,
suffix?: string,
)

Create an instance of MediaType by providing the components of type, subtype and optionally a suffix.

Properties

subtype: string

The subtype of the media type.

suffix: string | undefined

The optional suffix of the media type.

type: string

The type of the media type.

Methods

Return the parsed media type in its valid string format.

Static Methods

parse(value: string): MediaType

Take a string and attempt to parse it into a MediaType object.