Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. HTTP Response Header

HTTP Response Header

Scheduled Pinned Locked Moved C / C++ / MFC
helphtmlagentic-aiquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    Nilesh K
    wrote on last edited by
    #1

    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

    S S 2 Replies Last reply
    0
    • N Nilesh K

      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

      S Offline
      S Offline
      sonshiro
      wrote on last edited by
      #2

      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/

      1 Reply Last reply
      0
      • N Nilesh K

        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

        S Offline
        S Offline
        Simon W 0
        wrote on last edited by
        #3

        You should give it a tag name, such as : Accept: image/gif I am seeking... For what? Why did you ask me for what? I don't know!

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups