Register to get access to free programming courses with interactive exercises

The usage of HTTP API HTTP API

Not every site has an API. For example, Hexlet guides only have several static HTML pages with text. We can say the same about many other sites: company websites, information sites, directories, etc. In what case is it necessary to use an HTTP API?

Mobile applications

A significant part of mobile applications is just a window to the server (backend): booking services, transfers, maps, messengers, social networks, and business applications. Such applications rarely work without the Internet. Almost every action by the user means requests are sent to servers to send or receive data.

TODO: interaction picture

JavaScript frontend

When we load any site on the Internet, there are two possible ways of how the page's appearance in the browser will form.

First, HTML pages are generated on the server and sent directly to the browser. After that, the browser processes links and sends direct requests to the server to update the page. In other words, we use no API in that case. Every operation with data and HTML occurs on the server. This method works well where there's little user interaction and many pages of text, such as with Wikipedia or Google.

Secondly, the loaded page contains JavaScript code that monitors and intercepts all events. Such pages update with the code, which loads into the browser and requests the server for the necessary data.

This method helps in places with many forms and complex interactions requiring instant reactions. For example, booking systems, chat rooms, games, and editors implement this way.

Services for Services

What HTTP APIs do under the hood is hidden from users. Web services interact with many other systems to get the data you want. It happens on the server, so it doesn't reach the user in their browser or mobile app. For example, no one makes the payment systems themselves. Developers use ready-made platforms that allow them to take money from users.

Stripe HTTP API

Let's look at the big picture

The API structure doesn't depend much on what we use it for. We can use the same API for the site, the mobile app, and other services.


Are there any more questions? Ask them in the Discussion section.

The Hexlet support team or other students will answer you.

About Hexlet learning process

For full access to the course you need a professional subscription.

A professional subscription will give you full access to all Hexlet courses, projects and lifetime access to the theory of lessons learned. You can cancel your subscription at any time.

Get access
130
courses
1000
exercises
2000+
hours of theory
3200
tests

Sign up

Programming courses for beginners and experienced developers. Start training for free

  • 130 courses, 2000+ hours of theory
  • 1000 practical tasks in a browser
  • 360 000 students
By sending this form, you agree to our Personal Policy and Service Conditions

Our graduates work in companies:

<span class="translation_missing" title="translation missing: en.web.courses.lessons.registration.bookmate">Bookmate</span>
<span class="translation_missing" title="translation missing: en.web.courses.lessons.registration.healthsamurai">Healthsamurai</span>
<span class="translation_missing" title="translation missing: en.web.courses.lessons.registration.dualboot">Dualboot</span>
<span class="translation_missing" title="translation missing: en.web.courses.lessons.registration.abbyy">Abbyy</span>
Suggested learning programs
profession
Development of front-end components for web applications
10 months
from scratch
Start at any time

Use Hexlet to the fullest extent!

  • Ask questions about the lesson
  • Test your knowledge in quizzes
  • Practice in your browser
  • Track your progress

Sign up or sign in

By sending this form, you agree to our Personal Policy and Service Conditions
Toto Image

Ask questions if you want to discuss a theory or an exercise. Hexlet Support Team and experienced community members can help find answers and solve a problem.