I have been unable to make a definitive choice and was hoping that somebody (or a combination of a couple of people) could point out the differences between using RestSharp versus ServiceStack's client services (keeping in mind that I am already using ServiceStack for my service). Here is what I have so far (differences only). The list is fairly small as they are indeed very similar:
ServiceStack
Pros
- Fluent Validation from my already created service POCO objects
- One API for both client and service
- Code reads better (i.e. Get<>(), Post<>())
Cons
- Some of my strings must be written out (i.e. If I make a GET request with query parameters, I must create that string in my code)
- I must create a different class for each Request/Response Type (JsonServiceClient, XmlServiceClient)
RestSharp
Pros
- Just about everything can be a POCO (i.e. If I make a GET request with query parameters, I just add the parameters via code)
- Switching between Request/Response types is simple (request.RequestFormat = DataFormat.Json/Xml)
Cons
- Manual Validation (beyond that found in the Data Annotations)
- Two APIs to learn (this is minor since they are both fairly simple)
- Code is not as readable at a glance (barely) (i.e. request.Method = Get/Post.. and main call is Execute< T >())
I was leaning towards RestSharp since it tends more towards straight POCO use and very little string manipulation, however I think ServiceStack might be acceptable to gain the validation and code that is more easily read.
So, here are the questions:
- Which do you prefer?
- Why the one over the other?
I know this is not a totally subjective question, but at bare minimum I am looking for the answer to this question (which is subjective):
- Are any of my findings incorrect and/or are there any that I missed?