writeContentType method

  1. @override
void writeContentType(
  1. Response response
)
override

Sets the Content-Type header to 'application/json; charset=utf-8'.

This method sets the 'Content-Type' header of the response to indicate that the content being returned is JSON encoded in UTF-8.

Implementation

@override
void writeContentType(Response response) {
  response.headers.set('Content-Type', 'application/json; charset=utf-8');
}