Homework for module 1
How about trying it out in practice? It's time to do the first homework.
You need to enable the terminal to work with the command line. On Windows, the desired application is called CMD, on MacOS - Terminal.
Use the curl console application (if it is not installed on your computer - fix it). It is designed specifically to send a request to a specific service and receive a response from there.
As an example, send an HTTP request to the BoredAPI service. This is a service that can pick up an activity for all occasions.
To do this, enter the following command in the terminal:
Please note that the address can be conditionally divided into two parts - before and after the question mark.
The first part is the request address itself. In this example - “http://www.boredapi.com/api/activity”
The second part is the request parameters. In the example - "type=diy". That is, the query parameter is “type” with the value “diy”. Thus, we indicated that we want to get such an activity that you can do on your own (diy - Do It Yourself).
See what response was received. Find the information you need in it. In further modules, we will analyze in detail in what form the response comes, what it consists of. At this stage, it is enough to understand that this is exactly what the response to the request from the backend looks like before it is logically processed and beautifully displayed on the frontend.
Check out the documentation for the service (http://www.boredapi.com/documentation) and make a more complex request with different parameters yourself. For example, find out what activity is suitable for a company that has more than 5 but less than 10 people.
To consolidate the material, try to master a more complex service. For example - https://www.alphavantage.co/
Read the documentation, get the exchange rate or stock quotes from the database.
Before use, you must register and obtain a personal access key.