Passing HTML to the response object
As D8 uses Symfony responses it's as simple as:

use Symfony\Component\HttpFoundation\Response;

...

$response = new Response(
  'Your HTML content here',
  Response::HTTP_OK,
  array('content-type' =&gt; 'text/html')
);

return $response;


See the docs for more information.