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. Send PostData and read URL Please Help!

Send PostData and read URL Please Help!

Scheduled Pinned Locked Moved C / C++ / MFC
helpcsharpasp-netsysadmintutorial
5 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.
  • L Offline
    L Offline
    Lucky the code machine
    wrote on last edited by
    #1

    Hi, I am trying to read a webpage, but to view the webpage PostData must be sent to the server. How do you do that? The PostData is long (ASP.Net, so includes the __VIEWSTATE). I just dont know how to send a post back to the server. I am sure its simple, but I have searched and cant find anthing. Please help me, I have been stuck on this for weeks. Thanks, Mike

    L 1 Reply Last reply
    0
    • L Lucky the code machine

      Hi, I am trying to read a webpage, but to view the webpage PostData must be sent to the server. How do you do that? The PostData is long (ASP.Net, so includes the __VIEWSTATE). I just dont know how to send a post back to the server. I am sure its simple, but I have searched and cant find anthing. Please help me, I have been stuck on this for weeks. Thanks, Mike

      L Offline
      L Offline
      led mike
      wrote on last edited by
      #2

      Lucky the code machine wrote:

      I am sure its simple

      Really? It is? Do you know how to perform an HTTP POST request? Do you know what the POST data requirements are for the page? Do you know how to form __VIEWSTATE data? Do you know if the site requires a session cookie? If it does do you know how to manage the cookie? Try reading the first thread in the forum "How to get an answer to your question". Pay attention to Item #2.

      led mike

      M L 2 Replies Last reply
      0
      • L led mike

        Lucky the code machine wrote:

        I am sure its simple

        Really? It is? Do you know how to perform an HTTP POST request? Do you know what the POST data requirements are for the page? Do you know how to form __VIEWSTATE data? Do you know if the site requires a session cookie? If it does do you know how to manage the cookie? Try reading the first thread in the forum "How to get an answer to your question". Pay attention to Item #2.

        led mike

        M Offline
        M Offline
        Mark Salsbery
        wrote on last edited by
        #3

        I'm sure it's simple. mmm cookies and fish... :beer:

        Mark Salsbery Microsoft MVP - Visual C++ :java:

        1 Reply Last reply
        0
        • L led mike

          Lucky the code machine wrote:

          I am sure its simple

          Really? It is? Do you know how to perform an HTTP POST request? Do you know what the POST data requirements are for the page? Do you know how to form __VIEWSTATE data? Do you know if the site requires a session cookie? If it does do you know how to manage the cookie? Try reading the first thread in the forum "How to get an answer to your question". Pay attention to Item #2.

          led mike

          L Offline
          L Offline
          Lucky the code machine
          wrote on last edited by
          #4

          led mike wrote:

          Do you know how to perform an HTTP POST request?

          No, this is what I need to know.

          led mike wrote:

          Do you know what the POST data requirements are for the page?

          Yes. I have monitored an IE session and trapped the outgoing HTTP post.

          led mike wrote:

          Do you know how to form __VIEWSTATE data?

          Yes, the viewstate will not change, so I will be sending it back as the server sent it out.

          led mike wrote:

          Do you know if the site requires a session cookie? If it does do you know how to manage the cookie?

          It does not require a session cookie. So, to be more specific with my question: How do I perform a HTTP POST request in C++?

          L 1 Reply Last reply
          0
          • L Lucky the code machine

            led mike wrote:

            Do you know how to perform an HTTP POST request?

            No, this is what I need to know.

            led mike wrote:

            Do you know what the POST data requirements are for the page?

            Yes. I have monitored an IE session and trapped the outgoing HTTP post.

            led mike wrote:

            Do you know how to form __VIEWSTATE data?

            Yes, the viewstate will not change, so I will be sending it back as the server sent it out.

            led mike wrote:

            Do you know if the site requires a session cookie? If it does do you know how to manage the cookie?

            It does not require a session cookie. So, to be more specific with my question: How do I perform a HTTP POST request in C++?

            L Offline
            L Offline
            led mike
            wrote on last edited by
            #5

            There are a number of classes (MFC WinInet library / Socket classes) and/or API's (WinInet API) all the way down to just using the Winsock API. Of course all of these classes and API's are well documented on the MSDN Web site. When using any of these solutions knowledge of the HTTP protocol[^] could prove valuable, but that's up to you.


            Last modified: after originally posted -- sorry about the forum mix up, my bad

            led mike

            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