13

I'm building a Windows Phone 7 Silverlight app. Is there any reason to use RestSharp instead of WebClient? I've looked around on the RestSharp site, but it's not immediately obvious what the benefits are.

2

1 Answer 1

21

RestSharp removes the following pain points:

  • Quirks in .NET's HTTP classes (basic authentication is broken, error handling for non-200 responses, etc)
  • Automatic deserialization from response data to POCOs
  • Simplified API (request.AddParameter(name, value) instead of manually compiling request bodies
  • Simplified request/response semantics, especially for async (however, it's opinionated for async and may not meet everyone's needs, in which case I would also suggest evaluating Hammock)

Deserialization is probably the biggest gain since for most APIs you don't have to do very much to get the XML or JSON into your C# objects.

I would check out these pages for more info

https://github.com/restsharp/RestSharp/wiki https://github.com/restsharp/RestSharp/wiki/RestSharp-Blog-Posts-and-Links

Feel free to post any questions here or on the Google Group

2
  • These links are dead. Any chance you can update them? Jan 13, 2015 at 19:47
  • Hi John, please confirm, can Restsharp be used in windows service? Or WinHttp the only option?
    – ivorykoder
    Sep 22, 2016 at 13:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.