I like to call it an unifier of kingdoms portable class library for calling RESTful services in .NET. It unifies the fluent interface kingdom with HttpClient and make http request from PCL a lot more easier.
##Compability Compiled to Profile 259 of PCL which includes the plataforms .NET 4.5, Windows Phone 8.x, Windows 8.x, Windows 10 UWP. It can be used also on iOS and Android with Xamarin.
#Nuget
Install-Package Restion
- Built using Fluent Interface
IRestionClient restionClient = new RestionClient()
.SetBaseAddress("http://foo.bar.com");
IRestionRequest restionRequest = new RestionRequest("/foo/")
.WithHttpMethod(HttpMethod.Post)
.WithContent(new Foo(){FooName = "1"})
.WithContentMediaType(MediaTypes.ApplicationJson)
.WithContentEnconding(Encoding.UTF8);
- Full Asynchronously
IRestionResponse<Foo> response = await restionClient.ExecuteRequestAsync<Foo>(restionRequest);
- Full Extendable
ISerializer serializer = new CustomSerializer();
IDeSerializer deSerializer = new CustomDeSerializer();
IRestionClient restionClient = new RestionClient()
.SetBaseAddress("http://foo.bar.com")
.SetSerializer(serializer)
.SetDeserializer(deSerializer);
- Creating IRestionClient By default it uses Json.NET for Serialization and Deserialization
IRestionClient restionClient = new RestionClient()
.SetBaseAddress("http://foo.bar.com");
- Creating the IRestionRequest
IRestionRequest restionRequest = new RestionRequest("/foo/")
.WithHttpMethod(HttpMethod.Post)
.WithContent(new Foo(){FooName = "1"})
.WithContentMediaType(MediaTypes.ApplicationJson)
.WithContentEnconding(Encoding.UTF8);
- Executing the Request It returns and instance of IRestionRequest
IRestionResponse<Foo> response = await restionClient.ExecuteRequestAsync<Foo>(restionRequest);
Vinicius Gualberto @Vinguan.
Fork me and send the pull requests =).