Initial commit
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RudderSdk.Core.Abstractions;
|
||||
|
||||
/// <summary>
|
||||
/// HTTP transport used by the SDK for every API call. Implementations serialize
|
||||
/// the request as JSON, attach the bearer token, and map non-success HTTP
|
||||
/// statuses to <see cref="RudderApiException"/> subclasses
|
||||
/// (401 → <see cref="RudderAuthException"/>).
|
||||
/// </summary>
|
||||
public interface IRudderTransport
|
||||
{
|
||||
/// <summary>
|
||||
/// Sends one API request and deserializes the JSON response.
|
||||
/// </summary>
|
||||
/// <param name="method">HTTP method (GET, POST, PUT, DELETE).</param>
|
||||
/// <param name="path">Absolute path starting at the API root, e.g. /sdk/v1/player/information.</param>
|
||||
/// <param name="request">Request body DTO, or null for bodyless requests.</param>
|
||||
/// <param name="accessToken">Current access token to send as a Bearer header, or null.</param>
|
||||
/// <param name="cancellationToken">Cancellation token.</param>
|
||||
Task<TResponse> SendAsync<TRequest, TResponse>(
|
||||
string method,
|
||||
string path,
|
||||
TRequest? request,
|
||||
string? accessToken,
|
||||
CancellationToken cancellationToken = default);
|
||||
}
|
||||
Reference in New Issue
Block a user