.NET中的代理身份验证-用于外部API [英] Proxy Authentication in .NET - for external API

查看:166
本文介绍了.NET中的代理身份验证-用于外部API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Twitter API(twitterizer)开发一个twitter消息实用程序.但是由于我在公司代理内,因此出现错误"407必需的代理身份验证".在调用API或使用默认代理设置之前,有什么方法可以验证用户身份?

I'm developing a twitter messaging utility using Twitter API (twitterizer). But since I'm within a corporate proxy, I'm getting the error '407 Proxy Authentication Required'. Is there any way to authenticate the user before calling the API or use the default proxy settings?

P.S内部,API使用HttpWebRequest.

P.S Internally the API is using HttpWebRequest.

推荐答案

这不能回答您的问题.但是,您遇到的错误显然是代理身份验证错误.

This does not answer your question. But the error you are getting is clearly a Proxy authentication error.

您可能要禁用或启用代理.

You might want to either disable or enable the proxy.

要禁用代理,请在App.config文件中添加以下配置

To disable the proxy, in the App.config file add the following configuration

<system.net>
  <defaultProxy enabled="false" useDefaultCredentials="false">
    <proxy/>
    <bypasslist/>
    <module/>
  </defaultProxy>
</system.net>

要启用代理并使用默认的代理设置(在IE中指定),请在您的App.config中添加此配置

To enable the proxy and to use the default proxy settings(specified in IE) add this configuration in your App.config

<system.net>
  <defaultProxy enabled="true" useDefaultCredentials="true">
    <proxy/>
    <bypasslist/>
    <module/>
  </defaultProxy>
</system.net>

这篇关于.NET中的代理身份验证-用于外部API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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