In previous chapters, we've been using the data from a JSON file or directly defined on the source code. While that has been working for our previous examples, it's not what we should do in real-world applications.
In this recipe, we will learn how to request data from an API. We will fetch a
GET request from a Heroku API to get a JSON response. For now, however, we are only going to display the JSON in a text element.
This app will be really simple. We will have a text component where we are going to display the response of the API. We will also add a button to request the data when pressed.
We need to create an empty app, in this case, we'll name it
RemoteApi. Feel free to use any other name; just ...