Where and how do you write HTTP Header in HTML5 ?

Discussion in 'Web Design' started by Dracchingan, Dec 7, 2018.

to remove all ads.
  1. Dracchingan

    Dracchingan New Member

    Messages:
    1
    Hello, I see this exemple on Wikipedia, I want to know if HTTP Header comes in an index.html, in all HTML pages or in a separate file with a specific extension ? And how you know how to begin it, since it's going to be HTML5, and if there are must features or default features ? And if beginning with HTTP/1.1 200 OK will make my index.html be accepted in https://validator.w3.org/nu/#textarea ? Actually I'm trying to understand how this feature works and how should I know how to write it ?

    HTML:
    HTTP/1.1 200 OK
    Date: Mon, 23 May 2005 22:38:34 GMT
    Content-Type: text/html; charset=UTF-8
    Content-Length: 138
    Last-Modified: Wed, 08 Jan 2003 23:11:55 GMT
    Server: Apache/1.3.3.7 (Unix) (Red-Hat/Linux)
    ETag: "3f80f-1b6-3e1cb03b"
    Accept-Ranges: bytes
    Connection: close
    
    <html>
    <head>
      <title>An Example Page</title>
    </head>
    <body>
      Hello World, this is a very simple HTML document.
    </body>
    </html>
    (Source: Wikipedia, Hypertext Transfer Protocol)
     
  2. chrishirst

    chrishirst Well-Known Member Staff Member

    Messages:
    2,677
    A HTTP header is a communication signal sent between server and client, it is NOT something you write into a page.

    What I think you are asking about is a Document Type Declaration (DTD) or 'doctype' not a header.

    https://www.w3schools.com/tags/tag_doctype.asp
     

Share This Page