Webclient.UploadString()发送一个空字符串

时间:2012-05-07 12:01:11

标签: c# post webclient

以下是一些代码:

var client = new WebClient();
client.BaseAddress = "http://localhost/";
client.Headers["Content-type"] = "application/x-www-form-urlencoded";
client.Proxy = null;
// The server gets the data
var responseStr = client.UploadString(url, data); 
...
// The server gets an empty post data
responseStr = client.UploadString(url, data); 

Webclient应该是一次性用品吗?

1 个答案:

答案 0 :(得分:0)

嗯,可能你不能试试这个:

WebClient client = new WebClient();
client.BaseAddress = "http://localhost/something.php";