简体   繁体   English

(HttpWebResponse)request.GetResponse()抛出操作已超时

[英](HttpWebResponse)request.GetResponse() throwing The operation has timed out

I am trying to post my data using HTTPWebRequest to third party WebAPI. 我正在尝试使用HTTPWebRequest将数据发布到第三方WebAPI。 My data gets posted successfully, however in my error log I see a log saying The operation has timed out in (HttpWebResponse)request.GetResponse(). 我的数据成功发布,但是在我的错误日志中,我看到一条日志,指出该操作在(HttpWebResponse)request.GetResponse()中超时。

I am unable to find out why though my data is posted successfully. 我无法找出为什么我的数据成功发布了。 Any suggestions? 有什么建议么?

Thanks in advance. 提前致谢。

Your request is sent to server successfully but you fail to get response. 您的请求已成功发送到服务器,但没有得到响应。 If it always happens, maybe the WebAPI takes a lot of time to deal with the request before sending response so that your HttpWebRequest doesn't wait anymore. 如果总是发生这种情况,则WebAPI可能会在发送响应之前花费大量时间来处理请求,以使HttpWebRequest不再等待。 Try setting HttpWebRequest.Timeout a large value. 尝试将HttpWebRequest.Timeout设置为较大的值。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM