5
如何在调用GetResponse方法之前将HttpWebRequest对象视为字符串?我希望看到的要求是这样的raw格式作为小提琴手:请参阅HttpWebRequest作为GetResponse之前的字符串,而不使用fiddler
Content-Type: multipart/form-data; boundary=---------------------------2600251021003
Content-Length: 338
-----------------------------2600251021003 Content-Disposition: form-data; name="UPLOAD_FILEName"; filename="Searchlight062210 w price.csv" Content-Type: application/vnd.ms-excel
,,,,,
-----------------------------2600251021003
Content-Disposition: form-data; name="submit"
submit
-----------------------------2600251021003--
我尝试下面的代码,但没有奏效,因为流是无法读取。
string GetRequestString(HttpWebRequest req)
{
Stream stream2 = req.GetRequestStream();
StreamReader reader2 = new StreamReader(stream2);
return reader2.ReadToEnd();
}
tracemode =“protocolonly”in app.config is not accepted – Brij 2010-08-28 12:29:58
@brz dot net,不要相信Visual Studio。只需运行你的代码,它就可以工作。肯定有这样的元素。它甚至在MSDN上声明:http://msdn.microsoft.com/en-us/library/ty48b824.aspx – 2010-08-28 12:31:39
+1伟人!意味着不需要小提琴手。 – Brij 2010-08-28 12:45:26