HttpWebRequest响应错误 [英] Httpwebrequest response error

查看:70
本文介绍了HttpWebRequest响应错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用针对Windows Phone 8的httpwebrequest.响应http请求时,我收到了错误消息,指出远程服务器返回了错误". .对于我提供的任何网址,我都会收到此错误.

I am working with httpwebrequest for windows phone 8. I am getting error in response of the http request stating that "The remote server returned an error" . I am getting this error for any url which I am giving.

我想这是因为它需要系统凭据才能进行验证.这可能是我得到的错误的问题吗?还是可能有其他问题?

I guess it is because it requires system credentials for verification. could this be the issue for the error I am getting  or could be any other issue?

我还如何给我的系统凭据来验证响应?

Also how do I give my system credentials for validating the response?

谢谢!

推荐答案

要开始对实际问题进行故障排除,可以使用Fiddler

To start troubleshooting the actual issue, you can use Fiddler http://www.fiddlertool.com to create the same request on your desktop and then check what the actual error code is.

如果这是身份验证错误(HTTP 401响应),则可以通过创建NetworkCredential类的实例并手动传递凭据来分配凭据属性.没有"CredentialCache".对于Windows Phone.

If it is an authentication error (HTTP 401 response), then you can assign the Credentials property by creating an instance of the NetworkCredential class and passing in the credentials manually. There is no "CredentialCache" for Windows Phone.


这篇关于HttpWebRequest响应错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆