mirror of
https://github.com/JKorf/CryptoExchange.Net.git
synced 2026-08-11 16:32:57 +00:00
d44a11c44e
Added LibraryHelpers.CreateHttpClientMessageHandle to standardize HttpMessageHandler creation Added REST client option for selecting HTTP protocol version Added REST client option for HTTP client keep alive interval Added HttpVersion to WebCallResult responses Updated request logic to default to using HTTP version 2.0 for dotnet core
71 lines
1.8 KiB
C#
71 lines
1.8 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Net.Http;
|
|
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>
|
|
/// 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>
|
|
/// <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 all headers
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
KeyValuePair<string, string[]>[] GetHeaders();
|
|
|
|
/// <summary>
|
|
/// Get the response
|
|
/// </summary>
|
|
/// <param name="cancellationToken"></param>
|
|
/// <returns></returns>
|
|
Task<IResponse> GetResponseAsync(CancellationToken cancellationToken);
|
|
}
|
|
}
|