How to get text from HTTP response

I am trying to develop a simple app:

  1. Send HTTP request
  2. 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

Does the server return a JSON response? What are the keys of this JSON?

Its return: “online” or “not connected”

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?

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.