Example of request with Delphi

Asked

Viewed 793 times

1

  • First you have to have the link to start consuming the data, type of authentication, data filtering and with the return will have access to JSON, would have to treat and feed your desktop system. At least that’s what I understood, if you have more information you would have to specify better in the question.

  • yes, I have the all right api and routes working. Vi q in the proper ide of Delphi has the restClient ...request and Response components. with them I can connect with the api using urlBase, now I want to take and send json and format to display on the system

  • Since you have JSON, now just treat it to view on the system. Here is an example of how to read data from JSON http://balaiotecnologico.blogspot.com/2013/07/lendo-dados-json-in-applications-delphi.html and in the documentation from Embarcadero http://docwiki.embarcadero.com/RADStudio/Rio/en/JSON. What would help you tbm, is the Postman, so you can see the structure that is returning.

  • vlw, that already helped.

1 answer

0

Hello, you can use Restrequest4delphi to consume the API: https://github.com/viniciussanchez/RESTRequest4Delphi

Just do it here:

begin
  TRequest.New.BaseURL('http://localhost:8888/users')
    .Accept('application/json')
    .Get;
end;

You can also use Trestrequest, Trestresponse and Trestclient native components to consume, or Tidhttp

Browser other questions tagged

You are not signed in. Login or sign up in order to post.