Reputation: 333
I am working on a project on Yammer Integration with our mobile product (IOS - C# Xamarin Monotouch). The underlying technique is integration using Yammer Rest Calls. For that purpose we are using RestSharp.
The call to the REST Service is pretty straight Create a RestClient object Create a RestSharp.RestRequest Execute the request using the rest client
However i am see that on the IPAD the call to REST service takes about 5 -6 seconds average. The IPAD is using an open network. The same call in a windows application using rest sharp and .Net is fast.
Any clues? Anyone encountered the same issue with RestSharp performance on IOS.
Regards Sid
Upvotes: 1
Views: 1911
Reputation: 5234
Here is a sample Json client using HttpClient:
https://github.com/sami1971/SimplyMobile/blob/master/Core/SimplyMobile.Web/JsonClient.cs
You would need to pass it a HttpClient and for this you can use ModernHttpClient from the Component Store which uses native HTTP implementation: http://components.xamarin.com/view/modernhttpclient
Plug in also your JSON serialize if you want to use the class as-is, they are found from the Plugins folder. For iOS there are the usual suspects; Json.NET, ServiceStack.Text and also your standard MS runtime serializer. ServiceStack is fastest of the serializers.
EDIT: Since this was upvoted I would like to add that there is now XLabs.Web component on NuGet that I based on this earlier source code. Works with the XLabs.Serialization serializers.
Upvotes: 3