within the implementation of a controller we can give the developer the possibility to react on the response type.

Here is some example code how this is done in rails:
http://apidock.com/rails/ActionController/MimeResponds/InstanceMethods/respond_to