Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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." 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;
        });
like image 778
Christopher Avatar asked Aug 08 '11 17:08

Christopher


1 Answers

Change the first line to

var client = new RestSharp.RestClient("http://10.0.1.20:8085");
like image 88
John Sheehan Avatar answered Nov 09 '22 18:11

John Sheehan