7digital / SevenDigital.Api.Wrapper

A fluent c# wrapper for the 7digital API
MIT License
16 stars 29 forks source link

One method on IHttpClient for get, post etc #127

Closed AnthonySteele closed 10 years ago

AnthonySteele commented 10 years ago

Here's the next one. This change reduces IHttpClient.Get(GetRequest request) and IHttpClient.Post(PostRequest request) to one method, IHttpClient.Send(Request request) where Request.Method identifies it as Get, Post or other.

This means that IHttpClient supports multiple http verbs and no further changes to this interface are needed if the implementation needs to change to better support verbs beyond get and post.

I am aware that this is a breaking change to clients that implement their own IHttpClient but this is necessary for further work on http verbs. I also think that updating a wrapper IHttpClient implementation will not take long at all.

GetRequestHander and PostRequestHandler now look very similar and are what limit us to Get and Post only. They are next.

AnthonySteele commented 10 years ago

All tests passing on this PR

gregsochanik commented 10 years ago

Nice one, I'm hoping to have time to go over this at some point this afternoon.