Question

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();
Était-ce utile?

La solution

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";
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top