Closed MFernstrom closed 7 years ago
I'm writing APIs and want to include a /docs page which is a standard HTML page, the rest of the actions return JSON data.
I can't figure out how to set the content type per action, only in the brokers BrookSettings, which affect every action.
Is there a way?
HttpResponse.ContentType := 'application/json'; You can do it in every action, or create a parent class that sets this in its overriden DoRequest / Request to reduce duplication.
HttpResponse.ContentType := 'application/json';
DoRequest
Request
Aha, thanks leledumdo.
I'm writing APIs and want to include a /docs page which is a standard HTML page, the rest of the actions return JSON data.
I can't figure out how to set the content type per action, only in the brokers BrookSettings, which affect every action.
Is there a way?