I have a windows form with a webbrowser control. Using this control, I need login to a website, and get and post data.
The login part will remain manually because various headers and cookies and created and stored.
However, is it possible to use the control to send post/get requests?
I do something like this and it works for me.
string postData = "value1=" + 1 + "&value2=" + 2 + "&value3=" + 3;
System.Text.Encoding encoding = System.Text.Encoding.UTF8;
byte[] bytes = encoding.GetBytes(postData);
string url = "http://www.domain.com/addSomething";
webBrowser1.Navigate(url, string.Empty, bytes, "Content-Type: application/x-www-form-urlencoded");
I hope it is of help.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With