mirror of
https://github.com/JKorf/CryptoExchange.Net
synced 2025-06-08 16:36:15 +00:00
Revert "Added a flexible way to write in request body"
This reverts commit 9030ffd333fc6c867b6397c3893f0f9286404363.
This commit is contained in:
parent
9030ffd333
commit
91fb08f75d
@ -143,7 +143,6 @@ namespace CryptoExchange.Net
|
|||||||
|
|
||||||
var request = RequestFactory.Create(uriString);
|
var request = RequestFactory.Create(uriString);
|
||||||
request.Method = method;
|
request.Method = method;
|
||||||
request.Parameters = parameters;
|
|
||||||
|
|
||||||
if (authProvider != null)
|
if (authProvider != null)
|
||||||
request = authProvider.AddAuthenticationToRequest(request, signed);
|
request = authProvider.AddAuthenticationToRequest(request, signed);
|
||||||
@ -156,15 +155,6 @@ namespace CryptoExchange.Net
|
|||||||
var returnedData = "";
|
var returnedData = "";
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (request.WriteCustomBody &&
|
|
||||||
request.CustomBody != null && request.CustomBody.Length > 0)
|
|
||||||
{
|
|
||||||
using (var requestStream = await request.GetRequestStream())
|
|
||||||
{
|
|
||||||
requestStream.Write(request.CustomBody, 0, request.CustomBody.Length);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var response = await request.GetResponse().ConfigureAwait(false);
|
var response = await request.GetResponse().ConfigureAwait(false);
|
||||||
using (var reader = new StreamReader(response.GetResponseStream()))
|
using (var reader = new StreamReader(response.GetResponseStream()))
|
||||||
{
|
{
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
@ -11,10 +10,6 @@ namespace CryptoExchange.Net.Interfaces
|
|||||||
Uri Uri { get; }
|
Uri Uri { get; }
|
||||||
WebHeaderCollection Headers { get; set; }
|
WebHeaderCollection Headers { get; set; }
|
||||||
string Method { get; set; }
|
string Method { get; set; }
|
||||||
Dictionary<string, object> Parameters { get; set; }
|
|
||||||
|
|
||||||
byte[] CustomBody { get; set; }
|
|
||||||
bool WriteCustomBody { get; set; }
|
|
||||||
|
|
||||||
void SetProxy(string host, int port);
|
void SetProxy(string host, int port);
|
||||||
|
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
@ -45,11 +44,6 @@ namespace CryptoExchange.Net.Requests
|
|||||||
set => request.Method = value;
|
set => request.Method = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Dictionary<string, object> Parameters { get; set; }
|
|
||||||
|
|
||||||
public byte[] CustomBody { get; set; }
|
|
||||||
public bool WriteCustomBody { get; set; } = false;
|
|
||||||
|
|
||||||
public Uri Uri => request.RequestUri;
|
public Uri Uri => request.RequestUri;
|
||||||
|
|
||||||
public void SetProxy(string host, int port)
|
public void SetProxy(string host, int port)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user