Thursday, July 3, 2014

[ StackOverflow.com ] - how to post data to specific URL using WebClient in C#

how to post data to specific URL using WebClient in C# - Stack Overflow

string URI ="http://www.myurl.com/post.php";
string myParameters ="param1=value1&param2=value2&param3=value3";

using (WebClient wc =newWebClient())
{
      wc
.Headers[HttpRequestHeader.ContentType]="application/x-www-form-urlencoded";
     
stringHtmlResult= wc.UploadString(URI, myParameters);
}

No comments:

Know us

Our Team

Tags

Video of the Day

Contact us

Name

Email *

Message *