If you want to output content directly (rather than sending JSON or returned the user back to the web site), you can do so.
Firstly, you must set the driver to not return back to the web site (covered earlier in this chapter).
Next, you must access the HTTP response using
This returns an object that extends from
for more details.
setBody() method on the response object to set the body to return. You can
also set any headers as required (this can be useful for sending back files, such as generated