如何在调用GetResponse方法之前将HttpWebRequest对象视为string? 我想要看到原始格式的请求像这样的小提琴手:
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--
我试过下面的代码,但没有工作,因为stream是不可读的。
string GetRequestString(HttpWebRequest req) { Stream stream2 = req.GetRequestStream(); StreamReader reader2 = new StreamReader(stream2); return reader2.ReadToEnd(); }
使用其IP地址读取远程计算机上的registry – OpenRemoteBaseKey的奇怪行为
InvisibleOperationException隐藏窗口时
如果wpf应用程序没有响应,然后自动重启
为什么我在尝试本地安装cs-script时出错?
从try语句(C#)中更改对象属性
声音不在我的应用程序中播放
从Win32_PrintJob获取总页数
寻找关于使用.NET和C ++托pipe与本地关系的build议
如何编译执行时不显示“未知发布者”的C#程序
如果是用于日志记录的目的,你可以通过把它放在你的app / web.config中来激活跟踪:
<system.diagnostics> <sources> <source name="System.Net.sockets" tracemode="protocolonly"> <listeners> <add name="System.Net.sockets" type="System.Diagnostics.TextWriterTracelistner" initializeData="network.log" /> </listeners> </source> </sources> <switches> <add name="System.Net.sockets" value="Verbose"/> </switches> <trace autoflush="true" /> </system.diagnostics>
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。