Share via


4.1 Translate Header

The following examples show the difference between requesting an entity and the source of an entity. This first example is a typical HTTP GET command as issued by a browser such as the Windows Internet Explorer browser.

Request:

 GET /Temp/world.asp HTTP/1.1
 Translate: t
 Host: localhost
 Accept: */*

Response:

  
 HTTP/1.1 200 OK
 Server: Microsoft-IIS/5.1
 Date: Wed, 28 Jun 2006 00:06:21 GMT
 Content-Length: 129
 Content-Type: text/html
 Set-Cookie: ASPSESSIONIDCSSTSCQB=IEEJDPNAAIJECIOOBLMMGDJM; path=/
 Cache-control: private
       <FONT SIZE="1">Hello World</FONT><BR>
       <FONT SIZE="2">Hello World</FONT><BR>
       <FONT SIZE="3">Hello World</FONT><BR>

An authoring application might want to retrieve the source of an entity, and then issue the same request, asking for the source of the entity, as shown in the following example.

Request:

  
 GET /Temp/world.asp HTTP/1.1
 Translate: f
 Host: localhost
 Accept: */*

Response:

  
 HTTP/1.1 200 OK
 Server: Microsoft-IIS/5.1
 Date: Wed, 28 Jun 2006 00:16:34 GMT
 Content-Type: text/plain
 Content-Length: 497
 ETag: "22a87614489ac61:c02"
 Last-Modified: Wed, 28 Jun 2006 00:16:19 GMT
 Accept-Ranges: bytes
 <%
 '***********************************************
 '*     Sample ASP Code                         *
 '*                                             *
 '***********************************************
 %>
 <%
 Dim I ' declare  loop variable
 %>
 <%
 ' Loop 3 times, adjusting the font size in each loop
 For I = 1 To 3 Step 1
 ' Output our HTML and text using the value of I as
 ' the FONT TAG SIZE attribute.
 %>
 <FONT SIZE="<%= I %>">Hello World</FONT><BR>
 <%
 Next ' continue looping
 %>

The only difference between these two requests is that the second request is requesting the source of an entity. This is a typical example of how the Translate header is used.