# AcceptMime Decorator operation response

Module
import { AcceptMime } from "@tsed/common"
Source/packages/common/src/mvc/decorators/method/acceptMime.ts

# Overview

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.

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

   @Get('/')
   @AcceptMime('application/json')
   public getResource(){}
 }
1
2
3
4
5
6
7

Other topics