主机头不能直接修改 [英] Host header cannot be modify directly

查看:101
本文介绍了主机头不能直接修改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我正在尝试为https请求设置主机头但是我收到以下错误:

这里代码:

Hi all,
I'm trying to set  the host header for a https request but I obtain the following error:

Here the code:




代码Snippet

推荐答案

使用以下hack

HttpWebRequest myHttpWebRequest =(HttpWebRequest)HttpWebRequest.Create(" host");
myHttpWebRequest.Proxy = new WebProxy(" ip");

Use the following hack

        HttpWebRequest myHttpWebRequest = (HttpWebRequest)HttpWebRequest.Create("host");
        myHttpWebRequest.Proxy = new WebProxy("ip");


这篇关于主机头不能直接修改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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