HttpClient vs RestSharp

Stesvis 1,041 Reputation points
2021-10-15T16:25:18.003+00:00

Silly question, but i am wondering if switching from HttpClient to RestSharp to execute API calls in my xamarin forms app would/could be beneficial in terms of stability, reliability and or speed.

I am getting lots of httpclient/network related errors from my users and they all happen during a GET/POST/PUT call....

====================

  • System.Net.Http.HttpRequestException or System.Net.WebException: Error Domain=NSURLErrorDomain Code=-1003 "A server with the specified hostname could not be found." [my comment: the endpoint is live and working fine]
  • NativeMessageHandler.SendAsync or NSUrlSessionHandler.SendAsync (System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) / System.Threading.Tasks.TaskCanceledException: A task was canceled.
  • System.Net.Http.HttpRequestException or System.Net.WebException: Error Domain=NSURLErrorDomain Code=-1005 "The network connection was lost."
  • System.Net.WebException: Error Domain=NSURLErrorDomain Code=-1004 "Could not connect to the server."
  • System.ObjectDisposedException: Cannot access a closed Stream

====================

Developer technologies | .NET | Xamarin
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.