Christopher
Christopher

Reputation: 149

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;
        });

Upvotes: 6

Views: 3315

Answers (1)

John Sheehan
John Sheehan

Reputation: 78104

Change the first line to

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

Upvotes: 6

Related Questions