简体   繁体   English

RestSharp无效的URI:URI方案无效

[英]RestSharp Invalid URI: The URI Scheme is not valid

I am trying to get my head wrapped around restsharp for windows phone 7. I am trying to use the POST method to feed some data to a server, but when it gets to the client.executeasync line, it crashes with the error "Invalid URI: The URI Scheme is not valid." 我试图让我的脑袋缠绕在Windows Phone 7的restsharp上。我正在尝试使用POST方法将一些数据提供给服务器,但是当它到达client.executeasync行时,它崩溃并出现错误“无效的URI” :URI Scheme无效。“ What am I missing? 我错过了什么?

        var client = new RestSharp.RestClient("10.0.1.20:8085");
        var request = new RestSharp.RestRequest("/test", RestSharp.Method.POST);

        request.AddParameter("param1", "value1", RestSharp.ParameterType.GetOrPost);
        request.AddParameter("param2", "value2", RestSharp.ParameterType.GetOrPost);
        request.AddParameter("param3", "value3", RestSharp.ParameterType.GetOrPost);
        request.AddParameter("param4", "value4", RestSharp.ParameterType.GetOrPost);

        client.ExecuteAsync(request, (response) =>
        {
            var auth = response.Content;
        });

将第一行更改为

var client = new RestSharp.RestClient("http://10.0.1.20:8085");

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM