質問

I currently have the below code, that throws an exception: UriFormatException: Invalid URI: The Authority/Host could not be parsed. on the WebRequest.Create line. What am I doing wrong?

        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();
役に立ちましたか?

解決

Shouldn't it be double slashes:

var path = "http://mwo.smurfy-net.de/api/oauth2/token?grant_type=client_credentials&client_id=1&client_secret=2";
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top