0

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

Developer
  • 295
  • 4
  • 16

1 Answers1

0

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.

Gerald Versluis
  • 30,492
  • 6
  • 73
  • 100
  • Thanks Gerald. I need an advise from you. The Restful API calls will be provided by customer. So, I don't know much about it. `1- If I use Refit, will it be any concern about technology which used to develop that Restful API calls?` `2- "All the code for the actual calls is generated at compile-time": Can you please suggest me any link to implement from scratch?` – Developer May 08 '18 at 11:09
  • The whole point of REST is that it relies on HTTP. So as long as the server provides you with valid HTTP requests and responses, all should be fine and you need not to worry about the technology that is behind it. I have written a blog post about it a while ago, maybe you will find it helpful: https://blog.verslu.is/xamarin/xamarin-forms-xamarin/less-repetitive-code-to-reach-rest-apis-for-your-xamarin-forms-app-with-refit/ – Gerald Versluis May 08 '18 at 11:12