In addition to telling the OP what they have to accomplish, you should actually explain how to do it (generally, this means with code.) Also, this post already has five answers, one of which is accepted, and is from four years ago. As such, I would recommend that you try to answer newer questions.
In your case since you are sending HTML response to client you will have to set the content type as text/html
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