Git Product home page Git Product logo

resteasyclient's Introduction

Rest Easy Client

Travis CI Build Status

Rest Easy Client is a Http(s) client library for calling RESTful services. It uses a generics model based convention to generate the routes being called, with overloads to specify routes directly as well.

In the future, I will be adding features such as:

  • caching (etags, client only)
  • async await
  • rich configuration and other bells as and whistles as I think of them.

I started this project in an attempt to streamline some of the http clients I normally write in my day job into something more reusable. This is also inspired by other convention-based frameworks I have noticed in the open source ecosystem as well.

Usage

Install in your project

PM> Install-Package RestEasyClient

Using the factory

Create your models / pocos and use the factory to start retrieving rest clients of the type of model. It will autogenerate routes based on that model.

var factory = new GatewayFactory("http://dummy.com");
var gateway1 = factory.GetCqrsGateway<MyModel>();
var gateway2 = factory.GetCqrsGateway<MyOtherModel>();

Do Http calls based on the type and it will build the routes for you based on convention. If they aren't correct, use the overloads to specify the type and let it handle JSON serialization for you:

var id = 15;
var result = gateway1.FindById(id);
gateway1.Delete(id);

And now the client supports async!

var search = new MySearchModel() { Name = "Grendel" };
var result = await gateway1.SearchAsync(search);

Platforms

Rest Easy Client is currently available on the following .NET Frameworks:

  • .NET 4.6

Check back again as I plan on supporting more in the near future!

resteasyclient's People

Contributors

tolowe avatar programatt avatar

Stargazers

Raj avatar Jon Goranson avatar  avatar

Watchers

 avatar Jon Goranson avatar

resteasyclient's Issues

Missing build target in csproj file for test project

Cloned your repo, and wasn't able to open all the projects in the solution due to a missing build target in the csproj file.

C:\code\RestEasyClient\src\RestEasyClient.Test\RestEasyClient.Test.csproj : error : The imported project "C:\code\RestEasyClient\src\packages\Microsoft.Bcl.Build.1.0.4\tools\Microsoft.Bcl.Build.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk. C:\code\RestEasyClient\src\RestEasyClient.Test\RestEasyClient.Test.csproj

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.