FillHK
December 10, 2020, 12:34pm
#1
I am trying to develop a simple app:
Send HTTP request
Show the response on a screen.
I have created a button -> added external API (etc)
As a result, I see that it works as expected - no problem there.
The main question of -> how to show on-screen (input field or label) with a server response.
Example of request: HTTP://site/?request=status
Example of server response: online/not connected
I would like to see the status near the button after I clicked on it.
Thx
kostas
December 10, 2020, 12:37pm
#2
Does the server return a JSON response? What are the keys of this JSON?
FillHK
December 10, 2020, 12:49pm
#3
Its return: “online” or “not connected”
kostas
December 10, 2020, 12:52pm
#4
Could you make it return the value in JSON format. For example:
{
"status":"online"
}
API feature supports only REST JSON APIs at the moment.
Also, is the status code of both responses the same?
kostas
December 10, 2020, 12:56pm
#5
Another way, if JSON format is not possible you could add a Webview that loads this specific URL in your Screen and display the returned text directly from the webview. You can even disable User Interaction Enabled
in the webview so your users cannot select or scroll the webview.