Recently I've been checking out Reactive Extensions (Rx) for .NET, specifically, a neat little library called Refit that the Rx team has built.

In a nutshell, it lets you specify an interface, then at build time, using the interface methods as a template, it'll use code generation to create REST-style stubs that will call GET/POST/PUT/DELETE APIs.
It's fantastic for just about any REST-style interface, with one exception: the Twitter API.

When specifying an interface with Refit, one would normally use this structure:

public interface MyApi { [Get("/my/api/get/{param}")] public Task<Result> GetMethod([AliasAs("param")]string myParam) [Post("/my/api/post")] public Task<Result> PostMethod(SomeObj parameters) }

And then call it like so:

var service = RestService.For<MyApi>(""); var getResult = service.GetMethod("test string going into querystring"); var postResult = service.PostMethod(new SomeObj() { ... });

Refit lets you specify POCO parameter types for GET queries, which get serialized into the querystring, and POCO parameter types as the body of non-GET methods.
However, up until yesterday, it did not let you specify a complex type to serialize into the querystring of a non-GET request. And Twitter's API being Twitter, you have to send requests using certain verbs, but most of the parameters need to go in the querystring (except for images). Thanks, Jack, really good API design there.

So, to get round this, I've been furiously trying to get complex querystring types working in non-GET methods.
I finally got unit tests to demo the failure in functionality, and as a result, a new version of Refit is now available on the Nuget gallery. Go check it out!