acceptedContentTypes property

List<ContentType> acceptedContentTypes
getter/setter pair

Types of content this ResourceController will accept.

If a request is sent to this instance and has an HTTP request body and the Content-Type of the body is in this list, the request will be accepted and the body will be decoded according to that Content-Type.

If the Content-Type of the request isn't within this list, the ResourceController will automatically respond with an Unsupported Media Type response.

By default, an instance will accept HTTP request bodies with 'application/json; charset=utf-8' encoding.

Implementation

List<ContentType> acceptedContentTypes = [ContentType.json];