1
0
mirror of https://github.com/JKorf/CryptoExchange.Net.git synced 2026-08-12 08:53:01 +00:00
Files
CryptoExchange.Net/CryptoExchange.Net/Interfaces/IRequest.cs
T

70 lines
1.8 KiB
C#

using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace CryptoExchange.Net.Interfaces
{
/// <summary>
/// Request interface
/// </summary>
public interface IRequest
{
/// <summary>
/// Accept header
/// </summary>
MediaTypeWithQualityHeaderValue Accept { set; }
/// <summary>
/// Content
/// </summary>
string? Content { get; }
/// <summary>
/// Method
/// </summary>
HttpMethod Method { get; set; }
/// <summary>
/// Uri
/// </summary>
Uri Uri { get; }
/// <summary>
/// HTTP protocol version
/// </summary>
Version HttpVersion { get; }
/// <summary>
/// internal request id for tracing
/// </summary>
int RequestId { get; }
/// <summary>
/// Set byte content
/// </summary>
/// <param name="data"></param>
void SetContent(byte[] data);
/// <summary>
/// Set string content
/// </summary>
void SetContent(string data, Encoding? encoding, string contentType);
/// <summary>
/// Add a header to the request
/// </summary>
/// <param name="key"></param>
/// <param name="value"></param>
void AddHeader(string key, string value);
/// <summary>
/// Get all headers
/// </summary>
/// <returns></returns>
HttpRequestHeaders GetHeaders();
/// <summary>
/// Get the response
/// </summary>
/// <param name="cancellationToken"></param>
/// <returns></returns>
Task<IResponse> GetResponseAsync(CancellationToken cancellationToken);
}
}