mirror of
https://github.com/JKorf/CryptoExchange.Net.git
synced 2026-08-13 01:12:59 +00:00
Various fixes
This commit is contained in:
+28
-2
@@ -1,5 +1,7 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Threading.Tasks;
|
||||
using CryptoExchange.Net.Interfaces;
|
||||
|
||||
namespace CryptoExchange.Net.Requests
|
||||
@@ -18,11 +20,30 @@ namespace CryptoExchange.Net.Requests
|
||||
get => request.Headers;
|
||||
set => request.Headers = value;
|
||||
}
|
||||
public string ContentType
|
||||
{
|
||||
get => request.ContentType;
|
||||
set => request.ContentType = value;
|
||||
}
|
||||
|
||||
public string Accept
|
||||
{
|
||||
get => ((HttpWebRequest)request).Accept;
|
||||
set => ((HttpWebRequest)request).Accept = value;
|
||||
}
|
||||
|
||||
public long ContentLength
|
||||
{
|
||||
get => ((HttpWebRequest)request).ContentLength;
|
||||
set => ((HttpWebRequest)request).ContentLength = value;
|
||||
}
|
||||
|
||||
public string Method
|
||||
{
|
||||
get => request.Method;
|
||||
set => request.Method = value;
|
||||
}
|
||||
|
||||
public Uri Uri => request.RequestUri;
|
||||
|
||||
public void SetProxy(string host, int port)
|
||||
@@ -30,9 +51,14 @@ namespace CryptoExchange.Net.Requests
|
||||
request.Proxy = new WebProxy(host, port);
|
||||
}
|
||||
|
||||
public IResponse GetResponse()
|
||||
public async Task<Stream> GetRequestStream()
|
||||
{
|
||||
return new Response(request.GetResponse());
|
||||
return await request.GetRequestStreamAsync();
|
||||
}
|
||||
|
||||
public async Task<IResponse> GetResponse()
|
||||
{
|
||||
return new Response(await request.GetResponseAsync().ConfigureAwait(false));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user