You have to tell the browser what you are sending back so that the browser can take appropriate action like launching a PDF viewer if its a PDF that is being received or launching a video player to play video file ,rendering the HTML if the content type is simple html response, save the bytes of the response as a downloaded file, etc.
some common MIME types are text/html,application/pdf,video/quicktime,application/java,image/jpeg,application/jar etc
In your case since you are sending HTML response to client you will have to set the content type as text/html