55 lines
1.9 KiB
C#
55 lines
1.9 KiB
C#
using RestSharp;
|
|
using System.Threading;
|
|
using System.Threading.Tasks;
|
|
using xHttpService.Constants;
|
|
using xIdentityService.Models;
|
|
using xHttpService.Interfaces;
|
|
using System.Collections.Generic;
|
|
|
|
namespace xIdentityService.Interfaces
|
|
{
|
|
public partial interface IXIdentityHttpProvider : IXHttpProvider
|
|
{
|
|
/// <summary>
|
|
/// Get an Instance of RestRequest ...
|
|
/// </summary>
|
|
/// <param name="endpoint"></param>
|
|
/// <param name="addXPoweredValue"></param>
|
|
/// <param name="params"></param>
|
|
/// <param name="headers"></param>
|
|
/// <param name="queryStrings"></param>
|
|
/// <returns></returns>
|
|
RestRequest GetRestRequest(
|
|
string endpoint,
|
|
bool addXPoweredValue = true,
|
|
IDictionary<string, string> @params = null,
|
|
IDictionary<string, string> headers = null,
|
|
IDictionary<string, string> queryStrings = null
|
|
);
|
|
|
|
/// <summary>
|
|
/// Handle Call Specific Request and retrieve Response
|
|
/// </summary>
|
|
/// <param name="client"></param>
|
|
/// <param name="request"></param>
|
|
/// <param name="method"></param>
|
|
/// <param name="supportRefreshingTokens"></param>
|
|
/// <param name="cancellationToken"></param>
|
|
/// <typeparam name="T"></typeparam>
|
|
/// <returns></returns>
|
|
Task<T> RunRestRequest<T>(
|
|
RestClient client,
|
|
RestRequest request,
|
|
XHttpMethod method,
|
|
bool supportRefreshingTokens = true,
|
|
CancellationToken cancellationToken = default
|
|
);
|
|
Task<XBaseRestResponse<T>> RunRestRequestByResponse<T>(
|
|
RestClient client,
|
|
RestRequest request,
|
|
XHttpMethod method,
|
|
bool supportRefreshingTokens = true,
|
|
CancellationToken cancellationToken = default
|
|
);
|
|
}
|
|
} |