Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 89864

Best approach calling API using Refit

$
0
0

Hi guys

I would like to know what is the best way or most efficient way to consume a RESTful API in a enterprise XF project using Refit.

I have built an existing app before using this way but I am not very proud of the code and I'd like to rewrite it from scratch, with better code and layering all the components, currently I am stuck with the data access layer.

I am using a singleton class where I put my http clients to reuse them, I am also using the native HttpClient (from Android and iOS) inside Xamarin Forms 4.1, is it ok to still keep using OkHttpclient?

I also use PRISM for MVVM and navigation.

Maybe someone has a current project that deals with consuming API using Refit and a good and clean way to use it? All the examples just show the basic usage

var loginService = RestService.For<ILoginService>(_httpClient);


Viewing all articles
Browse latest Browse all 89864

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>