Jump to content
Suchin

getting response Text/html rather then JSON body

Recommended Posts

Hello sir,

when we pass parameter on demo account for below link

POST https://ciapi.cityindex.com/TradingAPI/order/newstoplimitorder

And got below response header with status code 200.

StatusCode: 200, ReasonPhrase: 'OK', Version: 1.1, Content: System.Net.Http.HttpConnectionResponseContent, Headers:
{
  Cache-Control: private
  Server: Microsoft-IIS/8.5
  X-AspNetMvc-Version: 5.2
  X-AspNet-Version: 4.0.30319
  X-Powered-By: ASP.NET
  Date: Mon, 31 Aug 2020 05:52:21 GMT
  Connection: keep-alive
  Content-Type: text/html; charset=utf-8
  Content-Length: 2953
}

Now in content type it is text/html rather then JSON.

we are making programming in C#. we are getting getting difficult to get retrieve the response body is the ApiTradeOrderResponseDTO in JSON format as suggest on gain capital "http://docs.labs.gaincapital.com/index.html#HTTP Services/Order.htm?Highlight=newstoplimitorder".

So please give us solution for this issue.

Share this post


Link to post

Hi Suchin,

The response for an entry order call is coming back as JSON from the server. I'm not sure what your initial call looks like that would return test/html, however the server is returning responses correctly.

Kind Regards, PM

image.png

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×