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. Web Development
  3. WebResponse problem!ٌ

WebResponse problem!ٌ

Scheduled Pinned Locked Moved Web Development
helphtmlcssdata-structurestutorial
5 Posts 4 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.
  • R Offline
    R Offline
    Rojan Gh
    wrote on last edited by
    #1

    I've written a code that creates a receives the request, sent by the web browser(I use FireFox), and then it parses the request and set the headers of a WebRequest object and if it finds any information after the empty line, it writes the information in the WebRequest object, then I get a WebResponse object out of the WebRequest object and creates 2 byte arrays, then it reads the WebResponse stream and puts the data in the first byte array and then puts the Header information of the WebResponse in the second array using the ToByteArray method of the WebResponse's Header propety. Then I have tried to methods for sending data to the web browser: 1)I have sent the Header array first in a separated Send method and then the Data array in a separated Send method after that, that makes the browser report the "Done" status and shows nothing! 2)I have added the data to the end of the header and sent them az a single Send method, that makes the browser show the html and css and jscript information but it leaves the places of the pictures empty! Does anyone know, what should I do to fix this problem? Should I send the header just if the data is in html/text format? Or the Gip/Png/Jpg of Application data formats also need the header? If they need, how to make the browser show the images and flashes? Please help!:(

    Sojaner!

    L G 2 Replies Last reply
    0
    • R Rojan Gh

      I've written a code that creates a receives the request, sent by the web browser(I use FireFox), and then it parses the request and set the headers of a WebRequest object and if it finds any information after the empty line, it writes the information in the WebRequest object, then I get a WebResponse object out of the WebRequest object and creates 2 byte arrays, then it reads the WebResponse stream and puts the data in the first byte array and then puts the Header information of the WebResponse in the second array using the ToByteArray method of the WebResponse's Header propety. Then I have tried to methods for sending data to the web browser: 1)I have sent the Header array first in a separated Send method and then the Data array in a separated Send method after that, that makes the browser report the "Done" status and shows nothing! 2)I have added the data to the end of the header and sent them az a single Send method, that makes the browser show the html and css and jscript information but it leaves the places of the pictures empty! Does anyone know, what should I do to fix this problem? Should I send the header just if the data is in html/text format? Or the Gip/Png/Jpg of Application data formats also need the header? If they need, how to make the browser show the images and flashes? Please help!:(

      Sojaner!

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Try checking your syntax.


      Extreme Exe

      E 1 Reply Last reply
      0
      • L Lost User

        Try checking your syntax.


        Extreme Exe

        E Offline
        E Offline
        Expert Coming
        wrote on last edited by
        #3

        Thats the help you supply? I'm sure you helped him very much.

        The only way to speed up a Macintosh computer is at 9.8 m/sec/sec.

        1 Reply Last reply
        0
        • R Rojan Gh

          I've written a code that creates a receives the request, sent by the web browser(I use FireFox), and then it parses the request and set the headers of a WebRequest object and if it finds any information after the empty line, it writes the information in the WebRequest object, then I get a WebResponse object out of the WebRequest object and creates 2 byte arrays, then it reads the WebResponse stream and puts the data in the first byte array and then puts the Header information of the WebResponse in the second array using the ToByteArray method of the WebResponse's Header propety. Then I have tried to methods for sending data to the web browser: 1)I have sent the Header array first in a separated Send method and then the Data array in a separated Send method after that, that makes the browser report the "Done" status and shows nothing! 2)I have added the data to the end of the header and sent them az a single Send method, that makes the browser show the html and css and jscript information but it leaves the places of the pictures empty! Does anyone know, what should I do to fix this problem? Should I send the header just if the data is in html/text format? Or the Gip/Png/Jpg of Application data formats also need the header? If they need, how to make the browser show the images and flashes? Please help!:(

          Sojaner!

          G Offline
          G Offline
          Guffa
          wrote on last edited by
          #4

          The response that you send back to the browser already has a header. If you want the header from the request that you got, you have to replace the current header, or extract the information from your header and add to the current header. When the browser displays the page, all the addresses of the images are wrong, as the address of the page is not the same as the address where you fetched the page. If you want the browser to find the images, you have to parse the page to find the image tags, and put adjusted or absolute URLs in them. Any other external files that the page might use also has to be corrected, like CSS, Javascript, Flash files, et.c.

          --- b { font-weight: normal; }

          R 1 Reply Last reply
          0
          • G Guffa

            The response that you send back to the browser already has a header. If you want the header from the request that you got, you have to replace the current header, or extract the information from your header and add to the current header. When the browser displays the page, all the addresses of the images are wrong, as the address of the page is not the same as the address where you fetched the page. If you want the browser to find the images, you have to parse the page to find the image tags, and put adjusted or absolute URLs in them. Any other external files that the page might use also has to be corrected, like CSS, Javascript, Flash files, et.c.

            --- b { font-weight: normal; }

            R Offline
            R Offline
            Rojan Gh
            wrote on last edited by
            #5

            But the page shows the tables and other elements using the styles from the css files, I have even saved the page after loading it, and found out that the css files and even the small images are loaded, the only problem is with the bigger files. In fact I want to write 2 programs the are client and server, the server is on my website host and the client on is on my pc and I want these 2 to do the "Tunneling Job" for me! I want the server to fetch the response of the web resources and send them to my PC hidden from my ISP! If you know how to write a set of client and server programs can do the Tunneling task, please guide my through this! I really need to do this!:(

            Sojaner!

            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