# 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
2
3
4
5
6
7
- Session & cookies
- Passport.js
- TypeORM
- Mongoose
- GraphQL
- Socket.io
- Swagger
- AJV
- Multer
- Serve static files
- Templating
- Throw HTTP Exceptions
- Customize 404
- AWS
- Jest
- Seq
- Controllers
- Providers
- Model
- Converters
- Middlewares
- Pipes
- Interceptors
- Authentication
- Hooks
- Injection scopes
- Custom providers
- Custom endpoint decorator
- Testing