1
0
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:
JKorf
2018-03-05 09:38:24 +01:00
parent 30301ab8d7
commit edcf91ca7c
6 changed files with 82 additions and 34 deletions
+28 -2
View File
@@ -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));
}
}
}