HTTP Response Header
-
Hi I've made a service which listens at a particular port for any requests coming from IE, and when i get the request I want to send some specific message to be displayed in html format by IE in order to do that I made following HTTP response header aString = "POST / HTTP/1.0\r\n\r\n"; aString += "Accept: image/gif, *.*\r\n"; aString += "Accept-Language: en\r\n"; aString += "\r\n"; aString += "User-Agent: MyAgent \r\n"; aString += "\r\n\r\n"; aString += "
Hello, World.
\r\n\r\n"; but something is going wrong and IE is unable to understand the response. Can anyone help me correct the problem ? Ciao - Nilesh
-
Hi I've made a service which listens at a particular port for any requests coming from IE, and when i get the request I want to send some specific message to be displayed in html format by IE in order to do that I made following HTTP response header aString = "POST / HTTP/1.0\r\n\r\n"; aString += "Accept: image/gif, *.*\r\n"; aString += "Accept-Language: en\r\n"; aString += "\r\n"; aString += "User-Agent: MyAgent \r\n"; aString += "\r\n\r\n"; aString += "
Hello, World.
\r\n\r\n"; but something is going wrong and IE is unable to understand the response. Can anyone help me correct the problem ? Ciao - Nilesh
The header that you are using is HTTP request header, that must be sent from client(WebBrowser) to server(WebServer). The HTTP response header, that is sent back from server to client, should have format like this. ---------------------------------------------------- HTTP 1.0 200 Document follows MIME-version: 1.0 Server: CERN 3.6 Date: Thursday, 13 June 96 12:30 GMT Content-Type: text/html Content-Length: 2103 Last-Modified: Wednesday, 12 June 96 23:53 GMT ... ---------------------------------------------------- * copy from [http://www.cs.sfu.ca/cs/undergrad/CourseMaterials/CMPT365/material/slides/A10.html\] You can study HTTP protocol from http://www.w3.org/
-
Hi I've made a service which listens at a particular port for any requests coming from IE, and when i get the request I want to send some specific message to be displayed in html format by IE in order to do that I made following HTTP response header aString = "POST / HTTP/1.0\r\n\r\n"; aString += "Accept: image/gif, *.*\r\n"; aString += "Accept-Language: en\r\n"; aString += "\r\n"; aString += "User-Agent: MyAgent \r\n"; aString += "\r\n\r\n"; aString += "
Hello, World.
\r\n\r\n"; but something is going wrong and IE is unable to understand the response. Can anyone help me correct the problem ? Ciao - Nilesh