locked
Request Headers, Response Headers? RRS feed

  • Question

  • User-1243272925 posted

    Hi Guys,

                  Can anyone explain what is page header? Request Headers, Response Headers?  How we can read them in asp .net.  Thanks in advance.

    Tuesday, October 27, 2009 5:21 AM

Answers

  • User-263151482 posted

    Request headers are the metadata that the user sends to the server like: browser version, browser language, user cookies etc.

    Response headers are the metadata that the server sends back to the user like: content type, cookies, date etc.

    You can get/set headers like this:

    string language = Request.Headers["Accept-Languge"] // browser languages
    Response.Headers["Content-Type"] = "text/html"; //html page


    There are also properties for the common use headers like:

    Response.ContentType = "text/html"
    Response.Charset= "ISO-8859-13"


    Response.ContentType
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, October 27, 2009 7:05 AM