Sobes.tech
Junior

How can you specify an HTTP header using a meta tag?

sobes.tech AI

Answer from AI

Using the http-equiv attribute.

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="refresh" content="5;url=http://example.com/">

Common values of http-equiv:

  • content-type: deprecated equivalent of the HTTP header Content-Type.
  • default-style: sets the name of an alternative CSS style.
  • refresh: specifies the time before automatic refresh or redirection of the page.
  • set-cookie: deprecated way to set cookies.
  • x-ua-compatible: used to specify compatibility mode with Internet Explorer.
  • content-security-policy: deprecated way to define content security policy.

It is important to remember that using meta with http-equiv does not replace full HTTP header configuration on the server. Server headers take precedence.

How can you specify an HTTP header using a meta tag… - sobes.tech