- What is an Http request?
- Life of a request
- REST
- Verbs
- Headers
- Status codes
- Example w/ curl
- Now how do we send a request with a browser?
- Websites of the early era required a complete page load upon each request (https://en.wikipedia.org/wiki/Ajax_(programming))
- This is inefficient and provides a bad user experience with full reloads on each action. Example: MapQuest in the early days.
- AJAX
- Gmail in 2004 and Google Maps in 2005
- A way for browsers to send requests asyncronously! 🎉
- In 2006, W3C releated XMLHttpRequest specification
- XMLHttpRequest
-
Open API's without need for auth tokens (https://github.com/public-apis/public-apis/blob/master/README.md). Use one for example.
-
Create new HTML file
-
Create a button that will have an event listener
-
Retrieve data from api with XMLHttpRequest obj
-
...but callbacks? joke