: What are the differences between a regular HTTP web server and a REST server? I am learning about REST services and from what I understood until now the only difference is the language of
I am learning about REST services and from what I understood until now the only difference is the language of the file that is outputted by the script that runs as a backend.
Can a regular web server that outputs a HTML file that contains the number of users of a website be considered a REST web service? After all it can be called by a program using a GET request and in the response body there is the number of students inside some tag that can be programatically read by an application after parsing the HTML file like it would parse a JSON of XML in case of more traditional REST service.
There are also web pages where it shows for example details of a book and the book id is sent through the GET request URL. That response may again be parsed by an application that called that URL with the GET verb and than the program can find out information about the book if it knows what is the structure of the HTML file. That again may be seen as a REST web service in my knowledge.
Am I wrong in the way I understood REST services until now?
More posts by @Kaufman445
1 Comments
Sorted by latest first Latest Oldest Best
HTTP is a standard method, a protocol, for transporting information. REST is a non-standard method for representing state of that information. REST requests take place using the HTTP protocol. That protocol gives methods of exchanging data via GET, POST, DELETE, etc. REST defines how to use those methods but those methods are part of HTTP.
Bad example, HTTP is the air carrying my voice to your ears. REST is how I ask you my question and you give me an answer.
Any web server that handles HTTP can also do REST but some servers, iirc, do not handle DELETE or PUT, both of which are used by REST. Note that REST uses GET/POST/DELETE/PUT but that's part of the HTTP protocol, not REST.
The structure of the HTML file means nothing. What matters is how the information is requested from the server. The state of the information, or page, is kept on the server. That URL remains a constant as it represents some information. Variations of the information change as the URL changes but you always retrieve it from the same URL.
I apologize for rambling cause it's been a while since I've studied this (and I just woke up).
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.