0

I'm trying to consume a simple API just for test, but it doesn't work using Delphi Rest Clients components.

Call to API works using browser and Postman without any configuration. The URL is https://api.cartolafc.globo.com/mercado/status

First I've tried use the tool "Rest Debugger" and it returns nothing.

So I tried to use the trio of REST CLIENT components by doing the following steps:

  1. Created a new project;
  2. Added TRestClient, TRestRequest and TRestResponse components;
  3. Configured BaseURL from TRestClient as "https://api.cartolafc.globo.com/mercado/status"
  4. Clicked the right mouse button on the TRESTRequest component
  5. Hit Execute... command

It returns the following error:

Error receiving data: (12152) the server returned an invalid or unrecognized response

Did I do something wrong?

Daniel Grillo
  • 2,368
  • 4
  • 37
  • 62
  • 1
    The json marshalling is very poor to begin with. And I don't know how it's in Rio, but in previous versions [support for gz compressed API was poor](https://stackoverflow.com/questions/27607506/trestclient-trestrequest-incorrectly-decodes-gzip-response) as well. – GolezTrol May 15 '19 at 16:15
  • Funny that using the URL https://api.stackexchange.com/2.2/users/511529?site=stackoverflow it works. – Daniel Grillo May 15 '19 at 17:19
  • Jup, apparently [they fixed that in 10.1 Berlin](https://quality.embarcadero.com/browse/RSP-9855) – GolezTrol May 15 '19 at 20:45

0 Answers0