1
0
mirror of https://github.com/JKorf/CryptoExchange.Net synced 2025-06-11 18:06:27 +00:00
2019-10-20 13:36:38 +02:00

57 lines
1.5 KiB
C#

using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading;
using System.Threading.Tasks;
namespace CryptoExchange.Net.Interfaces
{
/// <summary>
/// Request interface
/// </summary>
public interface IRequest
{
/// <summary>
/// Accept header
/// </summary>
string Accept { set; }
/// <summary>
/// Content
/// </summary>
string? Content { get; }
/// <summary>
/// Method
/// </summary>
HttpMethod Method { get; set; }
/// <summary>
/// Uri
/// </summary>
Uri Uri { get; }
/// <summary>
/// Set byte content
/// </summary>
/// <param name="data"></param>
void SetContent(byte[] data);
/// <summary>
/// Set string content
/// </summary>
/// <param name="data"></param>
/// <param name="contentType"></param>
void SetContent(string data, 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 the response
/// </summary>
/// <param name="cancellationToken"></param>
/// <returns></returns>
Task<IResponse> GetResponse(CancellationToken cancellationToken);
}
}