GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - albertjan/DynamicRestClient: A Dynamic REST Client

BranchesTags
Open more actions menu

Latest commit

 

History

94 Commits
94 Commits

Folders and files

NameName
Last commit message
Last commit date
src
src
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
README.markdown
README.markdown
 
 
appveyor.yml
appveyor.yml
 
 
license.txt
license.txt
 
 

Repository files navigation

DynamicRestClient

Build status Gitter

A simple REST client. Using Dynamics.

Lets asume there is a api at someapi.com which has a route /things to which you can do a get request it will return json containing a list of thing objects. You could write a client for this api like this:

//New up a new client
dynamic me = new RESTClient ();

//Set the url 
me.Url = "http://someapi.com";

//Get Things!
IEnumerable<Thing> things = client.GetThings();

ImpromptuInterface lets you do this:

//create an iterface to make it place nice again
public interface IAmAThingGetter
{
	IEnumerable<Thing> GetThings();
}

//makes client behave typesafe
IAmAThingGetter client = Impromptu.ActLike<IAmAThingGetter>(me);

//makes things typesafe-ish :)
var things = client.GetThings();

Isn't it cute. More to come see the tests for more usages.

##Recently added##

  • Automatic deserialisation of the response object to the type of the variable it's put into.
  • Automatic xml deserialisation to the generic function argument type if the contenttype is application/xml.
  • Support for single noun function calls client.Resolve("id"); will result in a GET /resolve/id.
  • Uri composition adjustable by Implementing IUriComposer and registering it with the container.
  • Serialisation of .net json dates /Date(millisecs-since-epoch)/ hacked into SimpleJson.
  • Glue things together with TinyIOC.

##To-do's##

  • Write more documentation
  • Get feedback
  • Content Negotiation + Deserialisation (protocol-buggers)
  • XML->dynamic and JSON->dynamic should be shipped with DRC
  • Maybe loose the ImpromtuInterface ref (half-done lost it in mono. don't think I will it's a nice tool)

About

A Dynamic REST Client

Resources

Readme
MIT license
Activity

Stars

3 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.