C# Класс ShipStationAccess.V2.Services.WebRequestServices

Показать файл Открыть проект

Открытые методы

Метод Описание
CanSkipException ( WebException e ) : bool
GetApiKey ( ) : string
GetResponse ( ShipStationCommand command, string commandParams, CancellationToken token, int? operationTimeout = null ) : T

Get response from ShipStation's endpoint

GetResponseAsync ( ShipStationCommand command, string commandParams, CancellationToken token, int? operationTimeout = null ) : Task

Get response from ShipStation's endpoint async

PostData ( ShipStationCommand command, string jsonContent, CancellationToken token, int? operationTimeout = null ) : void

Post data to ShipStation's endpoint

PostDataAndGetResponse ( ShipStationCommand command, string jsonContent, CancellationToken token, bool shouldGetExceptionMessage = false, int? operationTimeout = null ) : T

Post data to ShipStation's endpoint and read response

PostDataAndGetResponseAsync ( ShipStationCommand command, string jsonContent, CancellationToken token, bool shouldGetExceptionMessage = false, int? operationTimeout = null ) : Task

Post data to ShipStation's endpoint and read response async

PostDataAndGetResponseWithShipstationHeader ( ShipStationCommand command, string jsonContent, CancellationToken token, bool shouldGetExceptionMessage = false, int? operationTimeout = null ) : T

Post data to ShipStation's endpoint with specific partner header value

PostDataAsync ( ShipStationCommand command, string jsonContent, CancellationToken token, int? operationTimeout = null ) : Task

Post data to ShipStation's endpoint async

WebRequestServices ( ShipStationCredentials credentials ) : System

Приватные методы

Метод Описание
CreateAuthenticationHeader ( ) : string
GetExceptionMessageFromResponse ( WebException ex, string responseString ) : string
GetRawResponseAsync ( string url, CancellationToken token, int? operationTimeout = null ) : Task

Get data from ShipStation's endpoint async

InitSecurityProtocol ( ) : void
IsRequestThrottled ( HttpResponseMessage responseMessage, string responseContent, int &rateResetInSeconds ) : bool
LogPostError ( string apiKey, string url, HttpStatusCode statusCode, string jsonContent, WebException x ) : void
LogPostError ( string apiKey, string url, HttpStatusCode statusCode, string jsonContent, string responseString, int? operationTimeout ) : void
LogPostInfo ( string apiKey, string url, string jsonContent, int? operationTimeout ) : void
LogUpdateInfo ( string apiKey, string url, HttpStatusCode statusCode, string jsonContent, int? operationTimeout ) : void
ParseResponse ( string jsonData ) : T
PostRawDataAsync ( string url, string payload, CancellationToken token, bool shouldGetExceptionMessage = false, int? operationTimeout = null, bool useShipStationPartnerHeader = false ) : Task

Post data to ShipStation's API endpoint async

RefreshLastNetworkActivityTime ( ) : void

This method is used to update service's last network activity time. It's called every time before making API request to server or after handling the response.

SetAuthorizationHeader ( bool useShipStationPartnerHeader = false ) : void
ThrowIfError ( string url, HttpResponseMessage responseMessage, string responseContent ) : void

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

CanSkipException() публичный Метод

public CanSkipException ( WebException e ) : bool
e WebException
Результат bool

GetApiKey() публичный Метод

public GetApiKey ( ) : string
Результат string

GetResponse() публичный Метод

Get response from ShipStation's endpoint
public GetResponse ( ShipStationCommand command, string commandParams, CancellationToken token, int? operationTimeout = null ) : T
command ShipStationCommand
commandParams string
token CancellationToken
operationTimeout int?
Результат T

GetResponseAsync() публичный Метод

Get response from ShipStation's endpoint async
public GetResponseAsync ( ShipStationCommand command, string commandParams, CancellationToken token, int? operationTimeout = null ) : Task
command ShipStationCommand
commandParams string
token CancellationToken
operationTimeout int?
Результат Task

PostData() публичный Метод

Post data to ShipStation's endpoint
public PostData ( ShipStationCommand command, string jsonContent, CancellationToken token, int? operationTimeout = null ) : void
command ShipStationCommand
jsonContent string
token CancellationToken
operationTimeout int?
Результат void

PostDataAndGetResponse() публичный Метод

Post data to ShipStation's endpoint and read response
public PostDataAndGetResponse ( ShipStationCommand command, string jsonContent, CancellationToken token, bool shouldGetExceptionMessage = false, int? operationTimeout = null ) : T
command ShipStationCommand
jsonContent string
token CancellationToken
shouldGetExceptionMessage bool
operationTimeout int?
Результат T

PostDataAndGetResponseAsync() публичный Метод

Post data to ShipStation's endpoint and read response async
public PostDataAndGetResponseAsync ( ShipStationCommand command, string jsonContent, CancellationToken token, bool shouldGetExceptionMessage = false, int? operationTimeout = null ) : Task
command ShipStationCommand
jsonContent string
token CancellationToken
shouldGetExceptionMessage bool
operationTimeout int?
Результат Task

PostDataAndGetResponseWithShipstationHeader() публичный Метод

Post data to ShipStation's endpoint with specific partner header value
public PostDataAndGetResponseWithShipstationHeader ( ShipStationCommand command, string jsonContent, CancellationToken token, bool shouldGetExceptionMessage = false, int? operationTimeout = null ) : T
command ShipStationCommand
jsonContent string
token CancellationToken
shouldGetExceptionMessage bool
operationTimeout int?
Результат T

PostDataAsync() публичный Метод

Post data to ShipStation's endpoint async
public PostDataAsync ( ShipStationCommand command, string jsonContent, CancellationToken token, int? operationTimeout = null ) : Task
command ShipStationCommand
jsonContent string
token CancellationToken
operationTimeout int?
Результат Task

WebRequestServices() публичный Метод

public WebRequestServices ( ShipStationCredentials credentials ) : System
credentials ShipStationCredentials
Результат System