RestSharp 104.2.0 Released

code, open source 0 comments suggest edit

Just shipped a new release of RestSharp to NuGet. For those who don’t know, RestSharp is a simple REST and HTTP API Client for .NET.

This release is primarily a bug fix release with a whole lotta bug fixes. It should be fully compatible with the previous version. If it’s not, I’m sorry.

Some highlights:

  • Added Task<T> Overloads for async requests
  • Serialization bug fixes
  • ClientCertificate bug fix for Mono
  • And many more bug fixes…

Full release notes are up on GitHub. If you’re interested in the nitty gritty, you can see every commit that made it into this release using the GitHub compare view.

I want to send a big thanks to everyone who contributed to this release. You should feel proud of your contribution!

Who are you and what did you do to Sheehan?!

Don’t worry! John Sheehan is safe and sound in an undisclosed location. Ha! I kid. I’m beating him senseless every day.

Seriously though, if you use RestSharp, you should buy John Sheehan a beer. Though get in line as Paul Betts owes him at least five beers.

-359John started RestSharp four years ago and has shepherded it well for a very long time. But a while back he decided to focus more on other technologies. Even so, he held on for a long time tending to his baby even amidst a lot of frustrations, until he finally stopped contributing and left it to the community to handle.

And the community did. Various other folks started taking stewardship of the project and it continued along. This is the beauty of open source.

We at GitHub use RestSharp for the GitHub for Windows application. A little while back, I noticed people stopped reviewing and accepting my pull requests. Turns out the project was temporarily abandoned. So Sheehan gave me commit access and I took the helm getting our bug fixes in as well as reviewing and accepting the many dormant pull requests. That’s why I’m here.

Why RestSharp when there’s HttpClient?

Very good question! System.Net.HttpClient is only available for .NET 4.5. There’s the Portable Class Library (PCL) version, but that is encumbered by silly platform restrictions. I’ve written before that this is harms .NET. I am hopeful they will eventually change it.

RestSharp is unencumbered by platform restrictions - another beautiful thing about open source.

So until Microsoft fixes the licensing on HttpClient, RestSharp is one of the only options for a portable, multi-platform, unencumbered, fully open source HTTP client you can use in all of your applications today. Want to build the next great iOS app using Xamarin tools? Feel free to use RestSharp. Find a bug in using it on Mono? Send a pull request.

The Future of RestSharp

I’m not going to lie. I’m just providing a temporary foster home for RestSharp. When the HttpClient licensing is fixed, I may switch to that and stop shepherding RestSharp. I fully expect others will come along and take it to the next level. Of course it really depends on the feature set it supplies and whether they open source it.

As they say, open source is about scratching an itch. Right now, I’m scratching the “we need fixes in RestSharp” itch. When I no longer have that itch, I’ll hand it off to the next person who has the itch.

But while I’m here, I’m going to fix things up and make them better.

Found a typo or error? Suggest an edit! If accepted, your contribution is listed automatically here.

Comments

avatar

27 responses

  1. Avatar for John Sheehan
    John Sheehan September 18th, 2013

    LIKE!

  2. Avatar for Jason Famularo
    Jason Famularo September 18th, 2013

    Any plans to update the Xamarin Components (with a capital C)?

  3. Avatar for saadware
    saadware September 18th, 2013

    Thanks for keeping the project alive. Great work all around everyone. :)

  4. Avatar for Özgür Sarıkamış
    Özgür Sarıkamış September 18th, 2013

    you've made an error with the link. it should be http://www.nuget.org/packag...

  5. Avatar for Adrian Cearnau
    Adrian Cearnau September 19th, 2013

    You know, RestSharp basically getting abandoned was the reason I switched to SpeakEasy. Nice to see that it's on good hands now :) and choice is good!

  6. Avatar for Jonathan Goldman
    Jonathan Goldman September 19th, 2013

    <3 <3 <3

  7. Avatar for dotnetchris
    dotnetchris September 19th, 2013

    I don't know about other people but I absolutely loathe System.Net.HttpClient

    The api/dsl of it is atrocious, nothing is obvious, everything is hard. it wants to throw so many exceptions. Even doing the most basic things like getting the raw http response content or status code& descriptions is monstrous. Everything is a minefield, you have no idea what methods will explode vs what will actually give you results.

    It seems like HttpClient was built in the vein of webforms + asp.net custom errors + IIS custom errors, aka the platform fights everything about you from actually running a real http server and using status codes for what they're meant for. That everything you do that is not 200 or 302 you're fought tooth and nail on.

  8. Avatar for haacked
    haacked September 19th, 2013

    Thanks! I fixed it.

  9. Avatar for haacked
    haacked September 19th, 2013

    Interesting. I haven't used it a huge amount. I wonder if it would make sense to someday rebuild RestSharp as a nice API on top of HttpClient. Not sure if that makes sense or not at all. :)

  10. Avatar for Jonathan Goldman
    Jonathan Goldman September 19th, 2013

    This is why I wrote speakeasy (https://github.com/jonnii/s... specifically because I wanted to do different things depending on the status code.

  11. Avatar for dotnetchris
    dotnetchris September 19th, 2013

    Is speakeasy awaitable?

  12. Avatar for Jonathan Goldman
    Jonathan Goldman September 19th, 2013

    yessir. i need to update the readme with an example.

  13. Avatar for Max Battcher
    Max Battcher September 20th, 2013

    Are you possibly confusing System.Net.Http.HttpClient and the old System.Net.HttpWeb*?

    System.Net.Http.HttpClient makes it very easy to check the response status code: http://msdn.microsoft.com/e...

    Admittedly, that is a strong typed enum it returns, but it contains a lot more than HTTP 200 and HTTP 302: http://msdn.microsoft.com/e...
    It doesn't throw exceptions for non-success error codes unless you call response.EnsureSuccessStatusCode(), and even that considers more than just 200 and 302 a successful status code.
    YMMV, but I've not had the problems you describe with System.Net.Http.HttpClient for what I've needed it to do.

  14. Avatar for dotnetchris
    dotnetchris September 22nd, 2013

    I absolutely am talking about the "modern" HttpClient. Honestly i think i might like the original web client more than the new one. The api is atleast straight forward and not a muddled mess, albeit overly noisy and verbose.

    EnsureSuccessStatusCode is called by like everything in HttpClient.

  15. Avatar for Den
    Den September 28th, 2013

    Great lib, but still not a Portable Class Library.

  16. Avatar for devtools.korzh
    devtools.korzh October 3rd, 2013

    Awesome!

  17. Avatar for Lars
    Lars October 10th, 2013

    Sorry to say there are a lack of documentation and some problems no one can't really figure out how to fix, like: http://stackoverflow.com/qu...

  18. Avatar for Stefan Moonen
    Stefan Moonen October 14th, 2013

    I'd like to know this as well, any progress on this?

  19. Avatar for haf
    haf October 26th, 2013

    Phil, you're awesome and I would positively love if you would continue stewarding RestSharp. Having tried both HttpClient and RestSharp, I can say that the API of RestSharp is superior. I'll try to submit pull requests if I find problems.

  20. Avatar for nho biet yeu
    nho biet yeu November 12th, 2013

    Thanks! I fixed it.- game kim cuong

  21. Avatar for Love Angels
    Love Angels November 14th, 2013
  22. Avatar for ischilling
    ischilling February 5th, 2014

    So is it still safe to use it for new projects, or should we search for something else, e.g. like the here mentioned speakeasy (https://github.com/jonnii/s... which seems not to be abandoned, but still doesn't look as mature as RESTSharp?

  23. Avatar for haacked
    haacked February 5th, 2014

    It's still safe to use. I'm just trying to get someone else to take over development.

  24. Avatar for todd
    todd June 19th, 2014

    If you're looking for an alternative to RestSharp, check out Flurl.Http http://tmenier.github.io/Flurl. Slightly different take on the problem, centered around the idea of fluently building then calling a URL. Portable, async, HttpClient under the hood. Still very new and I'm wide open to suggestions. @haacked:disqus , @johnsheehan:disqus would LOVE your thoughts/opinions!

  25. Avatar for Bill Sorensen
    Bill Sorensen June 30th, 2015

    I have to agree. I've spent hours (and scoured Stack Overflow) trying to call a third-party API that expects a Content-Type header on GET requests. HttpClient considers this a protocol violation and will NOT let you do it. I plan to try RestSharp.

    Edit: RestSharp worked great, and was significantly easier to use than HttpClient.

  26. Avatar for dotnetchris
    dotnetchris June 30th, 2015

    I've also had good success with https://github.com/hhariri/... one thing that really separates EasyHttp from others is that it does not depend on JSON.NET. This can be either a pro or a con depending on your needs. The JSONFX serializer is ridiculously slow compared to things like JIL and others out there. Not that i've found too many people to actually ever have a real concern about serialization performance being a bottleneck in their system

  27. Avatar for sanu
    sanu October 19th, 2015

    Until I stumbled upon this site I always thought RestSharp is a library to test RestAPIs. We have been using RestSharp library with NUnit for testing our APIs at our company and nobody really knows what is it so good about RestSharp compared to other tools like SoapUI and why is it chosen against other tools for our testing. So, I thought I'll look outside for answers. Given the overhead for maintaining the code, I think there are other easy to use tools to perform API testing.

    Could you please explain me the advantages of using RestSharp over other tools available in the market?