Application Programming Interface
Real-life API example
When we need to navigate, we use a «Maps» application (Google Maps, Yandex Maps).
«Maps» provide geographic information not only to users but also to other applications via an API.
The «Navigator» application acts as the client, while the «Maps» application is the server.
- The «Navigator» sends a request over the HTTPS protocol with parameters for the starting and ending points of the route in JSON
- Receives a response in JSON format from the «Maps» application
- Displays the route, nearby gas stations, and warns about traffic congestion


Act as a client. Send the server the coordinates to save the starting point.
Fill out the form «HTTP request form» and send an HTTP request to the server.
Request format agreement:
-
URL address
of the requested resource:
/startpoint
(in this case, we only use the address ending, i.e., the endpoint) - HTTP methodcorresponding to sending new data to the server
-
Header
with content type
application/json
(indicates that the data will be sent in JSON format) - Request body must contain the parameters latitude and longitude in JSON format
Key | Description | Type | Required * | Constraints |
---|---|---|---|---|
latitude | latitude | number | + | from -90.0 to 90.0 |
longitude | longitude | number | + | from -180.0 to 180.0 |
* Required indicates whether the field must be specified:
+, Y, Yes, Да, 1 — required
-, N, No, Нет, 0..1 — optional
Уровень повышен!
Временное предложение
Премиум со скидкой!