/// <summary> /// Basic HEAD method: returns status and body /// </summary> /// <param name="partialUri">Uri part after server address/fqdn and port</param> /// <param name="parameters">Request parameters after `?`</param> /// <param name="headers">Request headers</param> /// <param name="authentificationProvider">Authentification provider</param> /// <param name="cancellationToken">Task cancellation token</param> /// <returns></returns> public static Task <RequestResult <string> > HeadRawAsync( string partialUri, IDictionary <string, string> parameters = null, IDictionary <string, string> headers = null, Delegates.AuthentificationDataAdder authentificationProvider = null, CancellationToken cancellationToken = default(CancellationToken)) => RegularClient.HeadRawAsync(partialUri, parameters, headers, authentificationProvider, cancellationToken);
/// <summary> /// Method tries to deserialize response as TResult or TError /// </summary> /// <typeparam name="TResult"></typeparam> /// <param name="partialUri">Uri part after server address/fqdn and port</param> /// <param name="parameters">Request parameters after `?`</param> /// <param name="headers">Request headers</param> /// <param name="authentificationProvider">Authentification provider</param> /// <param name="cancellationToken">Task cancellation token</param> /// <returns></returns> public static Task <RequestResult <TResult> > GetAsync <TResult>( string partialUri, IDictionary <string, string> parameters = null, IDictionary <string, string> headers = null, Delegates.AuthentificationDataAdder authentificationProvider = null, CancellationToken cancellationToken = default(CancellationToken)) where TResult : class => RegularClient.GetAsync <TResult>(partialUri, parameters, headers, authentificationProvider, cancellationToken);
/// <summary> /// Method tries to deserialize response as TSuccess and then as ApiErrorView /// </summary> /// <typeparam name="TSuccess">Success response type</typeparam> /// <param name="partialUri">Uri part after server address/fqdn and port</param> /// <param name="parameters">Request parameters after `?`</param> /// <param name="headers">Request headers</param> /// <param name="authentificationProvider">Authentification provider</param> /// <param name="cancellationToken">Task cancellation token</param> /// <returns></returns> public static Task <VariadicRequestResult <TSuccess, ApiErrorView> > GetWithApiErrorAsync <TSuccess>( string partialUri, IDictionary <string, string> parameters = null, IDictionary <string, string> headers = null, Delegates.AuthentificationDataAdder authentificationProvider = null, CancellationToken cancellationToken = default(CancellationToken)) where TSuccess : class => RegularClient.GetWithApiErrorAsync <TSuccess>( partialUri, parameters, headers, authentificationProvider, cancellationToken );
/// <summary> /// Deletes object and returns deserialized TSuccess or ApiErrorView /// </summary> /// <param name="partialUri">Uri part after server address/fqdn and port</param> /// <param name="parameters">Request parameters after `?`</param> /// <param name="headers">Request headers</param> /// <param name="data">Raw request body</param> /// <param name="authentificationProvider">Authentification provider</param> /// <param name="cancellationToken">Task cancellation token</param> /// <returns>Response result and deserialized body</returns> public static Task <VariadicRequestResult <string, ApiErrorView> > DeleteWithApiErrorAsync( string partialUri, IDictionary <string, string> parameters = null, IDictionary <string, string> headers = null, object data = null, Delegates.AuthentificationDataAdder authentificationProvider = null, CancellationToken cancellationToken = default(CancellationToken)) => RegularClient.DeleteWithApiErrorAsync( partialUri, parameters, headers, data, authentificationProvider, cancellationToken );
/// <summary> /// Puts object and returns success string or TError /// </summary> /// <typeparam name="TError">Error response type</typeparam> /// <param name="partialUri">Uri part after server address/fqdn and port</param> /// <param name="parameters">Request parameters after `?`</param> /// <param name="headers">Request headers</param> /// <param name="data">Raw request body</param> /// <param name="authentificationProvider">Authentification provider</param> /// <param name="cancellationToken">Task cancellation token</param> /// <returns>Response result and deserialized body</returns> public static Task <VariadicRequestResult <string, TError> > PutVariadicAsync <TError>( string partialUri, IDictionary <string, string> parameters = null, IDictionary <string, string> headers = null, object data = null, Delegates.AuthentificationDataAdder authentificationProvider = null, CancellationToken cancellationToken = default(CancellationToken)) where TError : class => RegularClient.PutVariadicAsync <TError>( partialUri, parameters, headers, data, authentificationProvider, cancellationToken);
/// <summary> /// Downloads file by uri into specified location /// </summary> /// <param name="partialUri">Uri part after server address/fqdn and port</param> /// <param name="parameters">Request parameters after `?`</param> /// <param name="headers">Request headers</param> /// <param name="fileName">Target file location. If null, then uri part after last slash will be used</param> /// <param name="allowRewrite">If false, ClientError will be returned if file exists</param> /// <param name="authentificationProvider">Authentification provider</param> /// <param name="cancellationToken">Task cancellation token</param> /// <returns></returns> public static Task <RequestResult <string> > GetFileAsync( string partialUri, IDictionary <string, string> parameters = null, IDictionary <string, string> headers = null, string fileName = null, bool allowRewrite = true, Delegates.AuthentificationDataAdder authentificationProvider = null, CancellationToken cancellationToken = default(CancellationToken)) => RegularClient.GetFileAsync(partialUri, parameters, headers, fileName, allowRewrite, authentificationProvider, cancellationToken);
internal static Task <RequestResult <TResult> > PerformRequestAsync <TBody, TResult>( HttpMethod method, string partialUri, IDictionary <string, string> parameters = null, IDictionary <string, string> headers = null, TBody bodyArg = default(TBody), Delegates.AuthentificationDataAdder authentificationProvider = null, Stream outputStream = null, CancellationToken cancellationToken = default(CancellationToken)) where TResult : class where TBody : class => RegularClient.PerformRequestAsync <TBody, TResult>(method, partialUri, parameters, headers, bodyArg, authentificationProvider, outputStream, RegularClient.AllowedRedirectCount, cancellationToken);
// ReSharper disable once FunctionComplexityOverflow internal static Task <VariadicRequestResult <TResponseSuccess, TResponseError> > PerformVariadicRequestAsync <TRequestBody, TResponseSuccess, TResponseError>( HttpMethod method, string partialUri, IDictionary <string, string> parameters = null, IDictionary <string, string> headers = null, TRequestBody bodyArg = default(TRequestBody), Delegates.AuthentificationDataAdder authentificationProvider = null, Stream outputStream = null, int redirectsLeft = 0, CancellationToken cancellationToken = default(CancellationToken)) where TRequestBody : class where TResponseSuccess : class where TResponseError : class => RegularClient.PerformVariadicRequestAsync <TRequestBody, TResponseSuccess, TResponseError>( method, partialUri, parameters, headers, bodyArg, authentificationProvider, outputStream, redirectsLeft, cancellationToken);