HttpWebRequest WebExcepton: The remote server returned an error: (407) Proxy Authentication Required.

1. Supply the credentials of the Currently Logged on User to the Proxy object similar to this:

// Begin code change by jeff

                    //  Obtain the ‘Proxy‘ of the  Default browser.
                    IWebProxy theProxy = aReq.Proxy;
                    // Print the Proxy Url to the console.
                    if (theProxy != null)
                    {
// Use the default credentials of the logged on user.
                        theProxy.Credentials = CredentialCache.DefaultCredentials;
                    }
                    // End code change by jeff

                    HttpWebResponse aResp = aReq.GetResponse() as HttpWebResponse;

  2. Add this property to the <<application>>.exe.config or machine.config file:

<system.net>
    <defaultProxy useDefaultCredentials="true"> </defaultProxy>
</system.net>

  link:http://blogs.msdn.com/b/jpsanders/archive/2009/03/24/httpwebrequest-webexcepton-the-remote-server-returned-an-error-407-proxy-authentication-required.aspx

时间: 2024-11-10 06:34:49

HttpWebRequest WebExcepton: The remote server returned an error: (407) Proxy Authentication Required.的相关文章

System.Net.WebException : The remote server returned an error: (415) UNSUPPORTED MEDIA TYPE

I am having problems with a bit of code that accesses a restful web service. Running this code, it errors out at var httpResponse = (HttpWebResponse)httpWebRequest.GetResponse(); and the exception returned is: "System.Net.WebException : The remote se

写Storage Table时报The remote server returned an error: (409) Conflict.

今天在往 Azure Storage Table中写入一条记录时,在刚开始老报 The remote server returned an error: (409) Conflict. 的异常,过了一阵子又好了.百思不得其解,后来终于在MSDN中找到了一段解释: When a table is successfully deleted, it is immediately marked for deletion and is no longer accessible to clients. Th

WebService:The remote server returned an error: (400) Bad Request

开发工具:VS2010.开发组件:WebService.运行环境:Windows 今天一个同事在进行计费接口联调试时,发现了一个非常奇怪的问题:接口在家里环境测试,一切正常,但是部署到现网环境之后,连续调用几次接口就会出现错误:The remote server returned an error: (400) Bad Request,然后回收一下WebService自己的程序池,再调用又可以了,再连续调用几次,又出现了上面的问题. 他来找我帮忙查问题,在了解整个过程之后,我就直接根据经验,设置

The remote server returned an error: (401) Unauthorized - 最妖root case,mark下

昨天用.net console application读取sharepoint list列表,在本地一切正常,一传到服务器上就报401未授权的错误,尝试了各种办法都没有解决.最后发现原因是我的AD账号只能在本机使用,在其他电脑上都不能用,非常雷人的root cause.也许是被管AD账号的同事坑了,也许是我的人品昨天有点差,特mark下,一来作为提醒,二来也是说明做事不要随便,走正规流程就不会出现类似的囧境. 原文地址:https://www.cnblogs.com/61007257Steven

Remote Server returned &#39;420 4.2.0 Recipient deferred because there is no Mdb&#39;

通常NDR会给我们排错带来很明确的指示 今天聊一个我日常运维中遇到的问题,首先我的环境是"单域多站点"模式,共有3个Site的Exchange,收件流依次是Exchange Online Protection---A Site Cas---A Site MBX---对应收件地址数据库. 根据NDR,发现,邮件从EOP下来后,反复在A Site的MBX中跳跃,直道完全失败.经过ECP.ADSI的检查,发现是A Site没有正确同步其他两个Site DC的用户属性(homeMDB) 解决办

react native初学之路--The development server returned response error code 500错误

最近学习的时候经常遇见这种错误,出现的错误种类一般不是一种,在stackOverflow中找到一种解决办法: 在项目跟目录运行下列代码: 1.yarn remove babel-preset-react-native 2.yarn add [email protected] 如果没有安装yarn可以用npm

Namenode主节点停止报错 Error: flush failed for required journal

主节点间歇性报错其他没有问题 ,SNN的NN没有问题,相关的journalNode也都在,就是主节点的NN会停止. 查看hadoop主节点的NN日志. 2016-11-21 22:36:40,908 WARN org.apache.hadoop.hdfs.qjournal.client.QuorumJournalManager: Waited 19822 ms (timeout=20000 ms) for a response for sendEdits. No responses yet. 2

“psql: could not connect to server: Connection refused” Error when connecting to remote database

问题: I am trying to connect to a postgres database installed in a remote server using the following command: psql -h host_ip -U db_username -d db_name This the error that occurs: psql: could not connect to server: Connection refused Is the server runn

Python GET REMOTE SERVER&#39;S INFO

1 #!/usr/bin/env python 2 #--*-- coding:utf-8 --*-- 3 # Python Network Programming Cookbook -- Chapter – 1 4 # This program is optimized for Python 2.7. 5 # It may run on any other version with/without modifications. 6 import socket 7 def get_remote_