7 AnswersNew Answer
So my understanding based on that is that AJAX refers to client side technologies whereas REST refers to server side protocols. Both are related to increasing the efficiency of web data flow.
there you go buddy https://stackoverflow.com/questions/23054764/can-someone-explain-the-difference-between-ajax-and-rest/23054929
Sonic,Daniel Adam Aaron Stone so if my ajax is returning a data in JSON format can it be treated as a REST api ? Thank you for your answers.
AJAX is an method to asynchronously load content, whilest REST is an architecture priciple for scaleable distributed API's.
In lay terms, You use rest API in your back-end, process data and output it to a webpage in JSON format. In your front-end, you use AJAX to access the data from the API and do anything you like with this data on your front end. Also note that AJAX can be also used in back-end as in the case of PHP AJAX. Real life example: A currency converter website provides *DATA* containing current currency rate and symbols through rest API. You access these DATA from you application through AJAX and make necessary conversions based on your user inputs and the conversion rates based on your question 2: The answer is no! REST API is the technique used in presenting this DATA
No. JSON has nothing to do with REST. An API is an application interface. An Application is an stateful system. A distributed system (like an orchastration of webservices) makes it difficult to represent a state (as services are independent). So REST propagates to use HATEOAS (hypermedia as the engine of application state). Together with resources (as states) you'll have a statemachine, that is: a distributed application. (REST has nothing to do with frameworks or technology, it's a principle, but implementation with http and json works very well on internet environments for a bunch of reasons).