If you need to set a custom header in an HTTP response, which HttpServletResponse method should you use?

  • addHeader(String name, String value)
  • appendHeader(String name, String value)
  • setHeader(String name, String value)
  • writeHeader(String name, String value)
To set a custom header in an HTTP response, you should use the setHeader(String name, String value) method of the HttpServletResponse interface.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *