WebClient post url and parameters and receive server response

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

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

Copy from https://*.com/questions/5401501/how-to-post-data-to-specific-url-using-webclient-in-c-sharp

 

WebClient post url and parameters and receive server response

上一篇:JS - in运算符


下一篇:.NET类库中的内置委托Action和Func