4.7 449 Response and Echo Reply
The following example shows a server returning a 449 response status along with a script to request that the browser set a cookie with the client's available screen dimensions. The client responds to the 449 response and echo request with an echo reply and the cookie that was generated as a result of executing the script.
Request:
-
GET /449/screen.449 HTTP/1.1 Host: localhost Accept: */*
Response:
-
HTTP/1.1 449 Reply With Content-Type: text/html Ms-Echo-Request: token Content-Length: 296 <html> <head> </head> <body onload="createCookie();"> <script language="JavaScript"> <!-- function createCookie() { strCookie = 'availWidth=' + screen.availWidth + '&availHeight=' + screen.availHeight; document.cookie = 'screen=' + strCookie; } --></script> </body> </html>
Echo reply:
-
GET /449/screen.449 HTTP/1.1 Host: localhost Accept:*/* Ms-Echo-Reply: token Cookie: screen=availWidth=800&availHeight=600
Final response:
-
HTTP/1.1 200 OK Content-Type: text/html Content-Length: 125 <html> <head> </head> <body> Please adjust your screen resolution to 1600 x 1200 to enjoy this content. </body> </html>