Skip to content

AcceptMime

@tsed/schema

Usage

typescript
import { AcceptMime } from "@tsed/schema";

See /packages/specs/schema/src/types/decorators/operations/acceptMime.ts.

Overview

ts
function AcceptMime(...mimes: string[]): Function;

Description

Set a mime list which are acceptable and checks if the specified content types are acceptable, based on the request’s Accept HTTP header field.

typescript
 @Controller('/mypath')
 export class MyCtrl {

   @Get('/')
   @AcceptMime('application/json')
   public getResource(){}
 }

Released under the MIT License.