Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/docker/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
c#WebRequest UriFormatException_C#_Webrequest - Fatal编程技术网

c#WebRequest UriFormatException

c#WebRequest UriFormatException,c#,webrequest,C#,Webrequest,我目前有以下代码,引发异常:UriFormatException:Invalid URI:无法解析权限/主机。在WebRequest上。创建行。我做错了什么 var path = "http:/mwo.smurfy-net.de/api/oauth2/token?grant_type=client_credentials&client_id=1&client_secret=2"; var request = (HttpWebRequest)WebR

我目前有以下代码,引发异常:UriFormatException:Invalid URI:无法解析权限/主机。在WebRequest上。创建行。我做错了什么

        var path = "http:/mwo.smurfy-net.de/api/oauth2/token?grant_type=client_credentials&client_id=1&client_secret=2";
        var request = (HttpWebRequest)WebRequest.Create(path);
        request.AllowAutoRedirect = false;
        var response = request.GetResponse();

不应该是双斜杠吗

var path = "http://mwo.smurfy-net.de/api/oauth2/token?grant_type=client_credentials&client_id=1&client_secret=2";

o、 哦,谢谢你,我知道这很愚蠢。真不敢相信我居然错过了30分钟:/