To review the core of web application, the core of web programming can be summarized into three phases. In this post, we will be covering the definitions surrounding the last step on how we can communicate with a server. For a detailed explanation of the first two phrases of web programming. You can check out my previous article here.
Best Coding Languages to Learn in 2019 | Data Driven Investor
During my years as an undergrad, I skipped many night-outs to pick up Java hoping it would one day help me get ahead in…
The Core of Web Programming
Manipulate the DOM
Communicate with the Server
What is an API
Application Programming Interface or API returns data in response to a request made by a client. An API is essentially an access point or endpoint that allows you to access a server’s database. You can think of it as essentially a doorman or butler standing at a door that you approach to ask questions. That butler will then go back into the manor and retrieve the information that you need. Not a perfect metaphor but you get the idea.
What is JSON
"name": "Luke Skywalker",
What is REST
Back to our interaction with the butler, you as the client approach the butler and your request has to be structured in a specific way that he understands. We interact with APIs through a set of URLs. Each URL defines a resource that we request or take action on. REpresentational State Transfer or REST is essentially an architectural design pattern to structure URLs. So for example, if you contact the butler that follows the REST convention that has access to a database of superheroes he understands 5 verbs.
What is AJAX
An asynchronous request is best described as ordering food from a restaurant. A waiter/butler takes an order from a customer/client. The waiter then takes the order back to the kitchen. The database/chef takes his or her sweet time to prepare a delicious meal. In an asynchronous order, the waiter is not waiting at the kitchen window for the chef to complete making the food before taking it to the customer. That would be too inefficient. Instead, the waiter goes to take another order from another customer and when the chef rings the call bell that the food is ready. The waiter will then deliver the food to the customer.
Hopefully, these definitions help you to understand the big picture of the web application’s server-side interactions. Each section contains way more complexity and nuance than I have described and they all deserve fuller explanations. However, an in-depth exposition on each topic is outside of the scope of this series and I encourage you to use the ideas here as landmarks on your journey of understanding. In my next article, I will walk through an example of an AJAX call to an API.