# Decorator AcceptMime
Decorator operation responseModule | 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
Other topics
- Session & cookies
- Passport.js
- TypeORM
- Mongoose
- GraphQL
- Socket.io
- Swagger
- AJV
- Multer
- Serve static files
- Templating
- Throw HTTP Exceptions
- Customize 404
- AWS
- Seq
- OIDC
- Stripe
- Controllers
- Providers
- Model
- JsonMapper
- Middlewares
- Pipes
- Interceptors
- Authentication
- Hooks
- Exceptions
- Hooks
- Response Filter
- Injection scopes
- Custom providers
- Custom endpoint decorator
- Testing