Y
Y
Yourmind2019-09-18 22:51:36
client-server
Yourmind, 2019-09-18 22:51:36

Rest when building websites?

Good day
Can anyone tell me more about how restip works when creating a website?
That is, as far as I know, rest gives us only the necessary data, for example json
But how does the browser know how to use it to display the page to the client?
If we have some kind of application created specifically for the client, and it sends a request, then it knows all this, for example this online bank application what we put on the phone
And if we go through the browser to the site in the bank's personal account, then the client is here the browser and he has no idea how to use the json that he will receive
I hope you understand my question

Answer the question

In order to leave comments, you need to log in

2 answer(s)
X
xmoonlight, 2019-09-18
@xmoonlight

The API is the server
The API client is (our special case!) JS in the browser.
1. The client requested
2. The API returned the data (e.g. in JSON)
3. The API client placed it in the DOM (processed the received data)
4. The user saw the result on the API screen
and the API Client always checks the version of the exchange protocol, and if it is updated to server, the client updates itself or asks the user to update.

R
Robur, 2019-09-18
@Robur

The browser loads the JavaScript of the personal account, which already accesses the rest api and knows how to display the received data. The browser itself just runs this JavaScript

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question