You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running my unit tests (environment = testing) it would be an advantage if I could return an entire response object from my controller, so I could analyse response headers (e.g. status code) and content.
When running in any other environment I would want my response to just return the rendered html without having to modify all my controller to have an if/else to check environment.
I also think it could be advantageous if I could just return a model from my controller and then have the "response middleware" check if the request accepted json or xml and then do the appropriate conversion, so I don't have to think about it in the controller.
Is this possible somehow?
The text was updated successfully, but these errors were encountered:
Brief elaboration on my use case(s):
When running my unit tests (environment = testing) it would be an advantage if I could return an entire response object from my controller, so I could analyse response headers (e.g. status code) and content.
When running in any other environment I would want my response to just return the rendered html without having to modify all my controller to have an if/else to check environment.
I also think it could be advantageous if I could just return a model from my controller and then have the "response middleware" check if the request accepted json or xml and then do the appropriate conversion, so I don't have to think about it in the controller.
Is this possible somehow?
The text was updated successfully, but these errors were encountered: