0
When I glue the address https://api.mercadolibre.com/sites/MLB/categories in the browser I see that the restfull API of the free market returns the data in JSON format, but when accessing the same link using the Restdebuger that comes with Delphi (Tools/Rest Debuger) I can only receive text/html.
I also tried to put a Restclient component in Delphi xe7 and configure the urlbase but gave it anyway. Someone knows how to do?
Note that this boy managed to do in delphiXE6, but this example did not work with me. See the link http://edgartec.com/delphi-xe6-consumir-la-api-rest-de-mercado-libre/
object RESTClient1: TRESTClient
Accept = 'application/json, text/plain; q=0.9;q=0.8,'
AcceptCharset = 'UTF-8, *;q=0.8'
AcceptEncoding = 'identity'
BaseURL = 'https://api.mercadolibre.com/sites/MLB'
ContentType = 'application/x-www-form-urlencoded'
Params = <>
HandleRedirects = True
Left = 168
Top = 8
end
object RESTRequest1: TRESTRequest
Accept = 'application/json, text/plain; q=0.9;q=0.8,'
Client = RESTClient1
Params = <
item
name = 'q'
Value = 'Smartphone'
end
item
name = 'price'
Value = '700.0-1000.0'
end>
Response = RESTResponse1
SynchronizedEvents = False
Left = 240
Top = 8
end
object RESTResponse1: TRESTResponse
ContentType = 'application/json'
RootElement = 'categories'
Left = 336
Top = 8
end
Thanks for your reply. I did not put code because I have no code. As I said, I used the Restdebugger tool, which generated the following objects: (see in the edited question)
– Ricardo da Rocha Vitor