version icsv858
unit OverbyteIcsHttpProt
procedure THttpCli.GetHeaderLineNext;
Line 3056: if Field = 'location' then begin { Change the URL ! }
I think is a bug,
Based on https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/201
The HTTP 201 Created success status response code indicates that the request has succeeded and has led to the creation of a resource.
So with Fstatuscode = 201 , there can be a location line in the http header as a normal response
Here is a example,
when I send a post to the server,the server response with a location line, but it was taken as a redirection ,so ICS resend the post to the new llocation again :
Connected to: api-fxtrade.oanda.com
> POST /v3/accounts/001-004-********-002/orders HTTP/1.1
...
api-fxtrade.oanda.com SSL Connected OK with TLSv1.2, cipher DHE-RSA-AES256-GCM-SHA384, key auth RSA, key exchange DH, encryption AESGCM(256), message auth AEAD
...
< HTTP/1.1 201 Created
< Location: https://api-fxtrade.oanda.com/v3/accounts/001-004-******-002/orders/240
< RequestID: 42647542696837564
= https://api-fxtrade.oanda.com/v3/accounts/001-004-******-002/orders Redirected to: https://api-fxtrade.oanda.com/v3/accounts/001-004-******-002/orders/240
Connected to: api-fxtrade.oanda.com
> POST /v3/accounts/001-004-******-002/orders/240 HTTP/1.1
ResponseRaw:{"errorMessage":"POST not allowed for endpoint."}
I change the code to
if (Field = 'location') and (FStatusCode <> 201) then begin { Change the URL ! }
The reponse is OK
So please check.