C# Класс ModernApp4Me.Universal.WebService.M4MWebServiceCaller

A basis class for making web service calls easier which uses RestSharp.Portable on Windows Phone. When invoking an HTTP method, the caller goes through the following workflow: The M4MWebServiceCaller.ExecuteHttpRequest methods is invoked : if the response HttpStatusCode is OK, the body is returned ad a string. if the HttpStatusCode is not OK, the private method M4MWebServiceCaller.OnHttpStatusCodeNotOk is invoked. if the HttpStatusCode is NotFound and the NetworkInformation.GetInternetConnectionProfile().GetNetworkConnectivityLevel() is equals to NetworkConnectivityLevel.None, a M4MConnectivityException is thrown. Otherwife, a M4MCallException is thrown.
Наследование: ModernApp4Me.Core.WebService.M4MBaseWebServiceCaller
Показать файл Открыть проект

Защищенные методы

Метод Описание
M4MWebServiceCaller ( string baseUrl ) : System.Net

Basis constructor.

OnHttpStatusCodeNotOk ( string resource, HttpStatusCode statusCode ) : void

Private function that raises an exception when the result code to a web method id not OK (not 20X).

Описание методов

M4MWebServiceCaller() защищенный Метод

Basis constructor.
protected M4MWebServiceCaller ( string baseUrl ) : System.Net
baseUrl string The base URL of the web service API
Результат System.Net

OnHttpStatusCodeNotOk() защищенный Метод

Private function that raises an exception when the result code to a web method id not OK (not 20X).
protected OnHttpStatusCodeNotOk ( string resource, HttpStatusCode statusCode ) : void
resource string The uri
statusCode HttpStatusCode the
Результат void