jgiacomini / Tiny.RestClient

Simpliest Fluent REST client for .NET
MIT License
210 stars 30 forks source link

AddUriParameter Support in Tiny.RestClient- Example Code Snippnet #92

Open aboah opened 5 years ago

aboah commented 5 years ago

Tiny.RestClient is a great library. Some of us believe it could upgraded to surpass all Http Client programs

Reference to old Issue on AddUriParameter, here is an Example

public void GET_with_resource_containing_tokens()         {             RestRequest request = new RestRequest("resource/{foo}");             request.AddUrlSegment("foo", "bar");             RestClient client = new RestClient(new Uri("http://example.com"));             Uri expected = new Uri("http://example.com/resource/bar");             Uri output = client.BuildUri(request);             Assert.AreEqual(expected, output);         }

public void POST_with_resource_containing_tokens()         {             RestRequest request = new RestRequest("resource/{foo}", Method.POST);             request.AddUrlSegment("foo", "bar");             RestClient client = new RestClient(new Uri("http://example.com"));             Uri expected = new Uri("http://example.com/resource/bar");             Uri output = client.BuildUri(request);             Assert.AreEqual(expected, output);         }

jgiacomini commented 5 years ago

Hello,

Thanks for the sample I understand better what you want. I will try to interate it on the next release

jgiacomini commented 5 years ago

If someone can help to implement this feature :)