Giter VIP home page Giter VIP logo

dynamicrestproxy's Introduction

DynamicRestProxy

NuGet package

A conventions based rest client using the .NET Dynamic Language Runtime.

The Wiki has further detail and examples, as does this article on codeproject.

This is a set of classes that wrap a concrete implementation of http client communication with a DynamicObject. The wrapper translates dynamic method invocations and endpoint paths into REST requests.

All requests are asynynchronous and return Task objects.

The intent is to make it easier to access REST API's from C# without needing to create strongly typed API wrappers and numerous static POCO types for basic DTO responses.

So a GET statement can be as simple as:

dynamic google = new DynamicRestClient("https://www.googleapis.com/");
dynamic bucket = await google.storage.v1.b("uspto-pair").get();
Console.WriteLine(bucket.location);

Or if you insist on static DTO types, a type argument can be supplied (deserialization uses Json.Net so all its rules and patterns apply):

dynamic google = new DynamicRestClient("https://www.googleapis.com/");
Bucket bucket = google.storage.v1.b("uspto-pair").get(typeof(Bucket));
Console.WriteLine(bucket.location);

Supports the GET, POST, PUT, PATCH and DELETE verbs.

Example usage is on the Wiki as well as supplied in the unit test projects.

If you try to run the unit tests take a close look at the CredentialStore class in the unit test project. It's pretty straighforward and you can use it to supply your own api keys while keeping them out of the code.

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.