0

我目前有以下代码,它会引发异常:UriFormatException:无效的 URI:无法解析授权/主机。在 WebRequest.Create 行上。我究竟做错了什么?

        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();
4

1 回答 1

1

不应该是双斜杠:

var path = "http://mwo.smurfy-net.de/api/oauth2/token?grant_type=client_credentials&client_id=1&client_secret=2";
于 2013-10-20T02:38:40.380 回答