Re: Retrieve Form Key-Values from HttpWebResponse

Discussion in 'ASP .Net' started by Joerg Jooss, Sep 21, 2004.

  1. Joerg Jooss

    Joerg Jooss Guest

    Erik Jensen wrote:
    > I have implemented HttpWebRequest and then coded HttpWebResponse
    > which reads into a stream and then into a string.
    >
    > By using the resultant string, stream, or Response, how do I get key
    > value pairs for the response form variables. Is it within
    > Response.Headers["FormKey1"].ToString()?


    No, HttpWebResponse itself is completely agnostic to what it contains -- it
    could be anything from a HTML document to a MP3 file.

    > or, do I work from the string which was the end result after my
    > Stream.ReadToEnd()?


    Yes, you need to search through the HTML document. Have a look at this blog
    entry, it could be helpful in your case:

    http://blogs.msdn.com/smourier/archive/2003/06/04/8265.aspx

    Cheers,

    --
    Joerg Jooss
    Joerg Jooss, Sep 21, 2004
    #1
    1. Advertising

  2. That post seemed to be in reference of a specific tool and can search through
    the html response for anchor tags and such. If the form data is contained
    within specific end tags and I can extract that then a split on "&" would
    yield an array of strings I could work with. Thanks for the tip though, im
    going to continue to look.

    erik

    "Joerg Jooss" wrote:

    > Erik Jensen wrote:
    > > I have implemented HttpWebRequest and then coded HttpWebResponse
    > > which reads into a stream and then into a string.
    > >
    > > By using the resultant string, stream, or Response, how do I get key
    > > value pairs for the response form variables. Is it within
    > > Response.Headers["FormKey1"].ToString()?

    >
    > No, HttpWebResponse itself is completely agnostic to what it contains -- it
    > could be anything from a HTML document to a MP3 file.
    >
    > > or, do I work from the string which was the end result after my
    > > Stream.ReadToEnd()?

    >
    > Yes, you need to search through the HTML document. Have a look at this blog
    > entry, it could be helpful in your case:
    >
    > http://blogs.msdn.com/smourier/archive/2003/06/04/8265.aspx
    >
    > Cheers,
    >
    > --
    > Joerg Jooss
    >
    >
    >
    >
    =?Utf-8?B?RXJpayBKZW5zZW4=?=, Sep 21, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?RXJpayBKZW5zZW4=?=

    Retrieve Form Key-Values from HttpWebResponse

    =?Utf-8?B?RXJpayBKZW5zZW4=?=, Sep 21, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    364
    =?Utf-8?B?RXJpayBKZW5zZW4=?=
    Sep 21, 2004
  2. Li Zhang
    Replies:
    4
    Views:
    6,040
    softip
    Feb 27, 2009
  3. Christoph Groth

    dict: retrieve the original key by key

    Christoph Groth, May 15, 2011, in forum: Python
    Replies:
    0
    Views:
    183
    Christoph Groth
    May 15, 2011
  4. Christoph Groth

    Re: dict: retrieve the original key by key

    Christoph Groth, May 15, 2011, in forum: Python
    Replies:
    5
    Views:
    283
    Ian Kelly
    May 16, 2011
  5. M P
    Replies:
    1
    Views:
    451
Loading...

Share This Page