0
I’m trying to make an application in Delphi to integrate ERP to the Free Market, and when using REST Debugger (for testing) this returning me an HTML and not Json, someone has already gone through it?
If using Postman returns the correct Json, however Delphi or REST Debugger only returns HTML.
Code used:
RESTClient.Accept := 'application/json';
RESTClient.BaseURL := 'api.mercadolibre.com/currencies?id=BRL';
RESTClient.AcceptCharset := 'UTF-8';
RESTClient.ContentType := 'application/json';
RESTRequest.Method := TRESTRequestMethod.rmGET;
RESTRequest.Execute;
Should return
{ "id": "BRL", "symbol": "R$", "description": "Real", "decimal_places": 2}
Returns
<!DOCTYPE html><!--if lt IE 7 ]> <span class="nt">"id"</span><span class="p">:</span> <span class="s2">"BRL"</span>
So, you’re passing Content-Type ?
– Luiz Santos
Modify your question by adding if possible at least part of the call code of your Delphi Rest function.
– Pedro Souza
Good morning, The code used is as follows:
– WANDARLEI MICHELON
Good morning, The code used is seginte: Restclient.Accept := 'application/json'; Restclient.Baseurl := 'https://api.mercadolibre.com/currencies?id=BRL'; Restclient.Acceptcharset := 'UTF-8'; Restclient.Contenttype := 'application/json'; Restrequest.Method := Trestrequestmethod.rmGET; Restrequest.Execute; Should return { "id": "BRL", "Symbol": "R$", "Description": "Real", "decimal_places": 2} Returns <! DOCTYPE html><! --if lt IE 7 ]> <span class="nt">"id"</span><span class="p">:</span> <span class="s2">"BRL"</span>... I use Delphi XE5. Grateful.
– WANDARLEI MICHELON
@WANDARLEIMICHELON edits the question, don’t put your code in the comments, because we can’t help you like this ;/
– Paz