POST and redirect via WebClient

  • Thread starter Thread starter 4D1 (thEsp)
  • Start date Start date
4

4D1 (thEsp)

Guest
Hi,

I would like to know is it possible and HOW CAN I post twice via same WebClient. What I really need is POST-ing to a specific URL, and then posting again to another instance of that URL. So it kinda goes like this: I enter something to test.com/form1 and then I post to test.com/form2 using the same credentials.


NameValueCollection postData = new NameValueCollection()
{
{ "username", username }, //order: {"parameter name", "parameter value"}
{ "referer", referer }
};

// client.UploadValues returns page's source as byte array (byte[])
// so it must be transformed into a string
string pagesource = Encoding.UTF8.GetString(client.UploadValues(urlAddress, postData));


Thanks in advance.

Continue reading...
 
Back
Top