Skip to content

PlaceOrderAsync throwing exception on Poloniex after changing to System.Net.Http.HttpClient. #610

Closed
@BZ-CO

Description

@BZ-CO

Exception is thrown after calling PlaceOrderAsync method on Poloniex.
I've also tested same method on Binance and it worked fine.
It happened after this commit. [babff91]

Exception details:
InvalidOperationException
ExchangeSharp.APIRequestMaker.InternalHttpWebRequest.AddHeader(String header, String value) in D:\ExchangeSharp-master\src\ExchangeSharp\API\Common\APIRequestMaker.cs:line 93
Misused header name. Make sure request headers are used with HttpRequestMessage, response headers with HttpResponseMessage, and content headers with HttpContent objects.

The problematic header seems to be content-length

Solution:
Changing Request.Headers.Add(header, value); to Request.Headers.TryAddWithoutValidation(header, value);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions