writeContentType abstract method

void writeContentType(
  1. Response response
)

Writes the content type to the headers of the given response.

This method sets the appropriate content type (e.g., 'application/json' for JSON, 'text/html' for HTML) in the response headers. It ensures that the client receiving the response knows how to interpret the data.

response - The response object where the content type header will be set.

Implementation

void writeContentType(Response response);