Page 260 - DCAP408_WEB_PROGRAMMING
P. 260
Web Programming
Notes The server returns the web page to the client.
Client Server
The client request a web page from the server
When the client requests a web page from the server it not only sends the URL of the web page
requested but also some additional information. This extra information consists of useful facts about
the client for example, what browser is being used, what operating system the client is running,
what URL the user just came from. Each piece of additional information is referred as a request
header,
A request header is a single line of text that browser sends to the web server when requesting to
view any web page.
When the server sends back the requested web page to the client, it also sends a set of headers,
known as response headers. Response headers are additional bits of information about the web
page being sent to the client. Both the request headers and the response headers are referred to,
more generally, as HTTP headers.
Did u know? What is HTTP header?
An HTTP header is a single piece of information, sent either from the client to the server,
when requesting a page, request.
11.1 Standard HTTP Headers
HTTP Header name Description
HTTP_ACCEPT A list of MIME type the client will Accept
HTTP_ACCEPT_LANGAGUE what type of language the browser expects
HTTP_CONNECTION the type of connection established between the client and web
server
HTTP_HOST the host name of the computer
HTTP_USER_AGENT the browser type and version and operatingsystem
information system of the client
HTTP_REFERER the full URL of the web page containing the hyperlink use to
reach the currently executing ASP page
HTTP_COOKIE the cookies sent from the browser
Reading HTTP Headers with Request.ServerVariables
Using ASP, one can read the headers that the browser sends to the web server using the request
object. Specifically, the use of the server variables is collections of the request objects. To display
HTTP headers simply issue the following statement:-
<%=Request.ServerVariables(“all_raw”)%>
This displays the exact list of header sent be the browser to the web server to display a formulated
list of headers, use the following commands:
<%=request.server variable (“HTTP_headername”) %>
254 LOVELY PROFESSIONAL UNIVERSITY