Cra*_*cyD 0 c# timeout using out httpwebresponse
我有一个像这样的方法
private bool VerbMethod(string httpVerb, string methodName, string url, string command, string guid, out HttpWebResponse response)
Run Code Online (Sandbox Code Playgroud)
我这样使用它
HttpWebResponse response;
if (VerbMethod("POST", "TheMethod", "http://theurl.com", "parameter1=a", theGuid, out response))
{
using (StreamReader sr = new StreamReader(response.GetResponseStream()))
{
string responseString = sr.ReadToEnd();
}
Run Code Online (Sandbox Code Playgroud)
它返回一个bool来指定方法是否顺利,并在out参数中设置响应以获取数据.
我有时会超时,然后后续请求也会超时.我看到这个SO WebRequest.GetResponse锁定了吗?
它重新启动using关键字.问题是,用上面的方法签名我不知道该怎么做.
using与out参数?HttpWebResponse?| 归档时间: |
|
| 查看次数: |
323 次 |
| 最近记录: |