What is the best approach to obtain the response from an API call and display it correctly in ShowMessage?
In the given scenario, we have two buttons that perform the same task in different ways. One button calls the function "GetApi_Runtime," which creates the request object, executes the API call, and returns the JSON in a string variable. The other button uses a pre-configured component to make the API call.
The question is:
When the component's event is triggered, the API response is correctly displayed in ShowMessage. However, when executing the "GetApi_Runtime" function, the response is not displayed in ShowMessage.
What would be the most appropriate approach to ensure that the API call response is correctly displayed in ShowMessage, regardless of whether the component or the "GetApi_Runtime" function is used? Unit1.dfm (1.3 KB) Unit1.pas (2.0 KB) Unit1.html (170 Bytes)
I apologize for my ignorance, but I really don't know...
What is the best way to obtain the information from TJSPromises? In the example below, I am passing a function with a string return, but when making the call, it doesn't return a string, but rather a TJSPromises.