Search code examples
restxamarin.formsxamarin.iosxamarin.androidrefit

Which one is best to consume Restful WebServices for Xamarin.Forms?


I want to go with Xamarin.Forms project. Now, I am bit confuse for consuming Rest API for this project. Performance matters.

There are many available but can any body please suggest me which should be best for Xamarin.Forms(.Net Standard)?

Microsoft Http Libraries or third party libraries like Refit, RESTSharp, PortableRest, etc.

Please suggest


Solution

  • All of these options are viable. I think the performance differences between these libraries will be marginal. So, it mostly comes down to what you feel comfortable with.

    I like to use Refit because it will take a lot of redundant code out of your hands and you just have to focus on the contract. All the code for the actual calls is generated at compile-time (and thus won't impact your performance at runtime).

    Also have a look at how well the library is maintained and if it's active. If you choose one that is already inactive for a while, chances are that you will start relying on older software versions which might not be what you want.