1. Home
  2. Training Library
  3. Amazon Web Services
  4. Courses
  5. Introduction to Amazon API Gateway



Course Introduction
Course Conclusion

The course is part of these learning paths

Solutions Architect – Professional Certification Preparation for AWS
Serverless Computing on AWS for Developers
course-steps 12 certification 1 lab-steps 8
Get Started Building Cloud Solutions
course-steps 14 certification 5 lab-steps 1
star star star star star-border



About the Author


Hello and welcome back to the API Gateway Course. This lesson introduces the foundation of the internet: HTTP HTTP stands for the Hypertext Transfer Protocol. Hypertext may be anything, it may be the plain text html used to maybe view the webpage you're looking at right now, images, audio files like mp3's or generally any data exchanged between two computers. HTTP follows the synchronous request and response model.

The client, or your browser for example, sends a request to the server. This server, like CloudAcademy.com handles the request and sends a webpage in response. Here we see the browser's URL bar. The server here uses the https protocol which is an encrypted version of HTTP. Next the domain specifies location of the server, and finally the path indicates what we want the server to send in response. The HTTP protocol has different methods to communicate what the server should do with a particular request. There are four universal methods.

GET is the most common. Your browser sends a GET request when you visit most webpages. POST requests create new data. This is used when submitting something like a payment form. PUT requests update existing resources on a server such as updating a profile on a website. While DELETE naturally deletes resources like a blog comment. These HTTP methods describe requests.

There are also rules for describing responses. Each response includes a numeric response code. The response codes tell the client how to handle the response. They arrange from 1xx to 5xx. You may know the 200 Okay or even the dreaded 404 Not Found. Each range indicates a different kind of response. 2xx and 5xx are the most common. 2xx responses like 200 Okay or 201 Created generally mean everything went as expected. 5xx codes like 500 mean a server had a problem generating a response. 3xx covers redirection and the 4xx range indicates there are problems with the request on the client's side.

Developers can use these rules to create API's. API stands for Application Programming Interface. These are rules programs use to communicate with each other. This is how we can have things like multiple Twitter clients even though there's only one Twitter service. This is because Twitter exposes an API for other people to build programs on top of. HTTP based API's are usually modeled with Representational State Transfer or REST.

REST uses the previously mentioned HTTP methods to model requests between the client and server. Here's an example: I'm gonna make a GET request to list all the blog posts, POST to create a new blog post, PUT to update an existing one, or DELETE to delete one. Let's demonstrate with the Google Maps API. Here we make a GET request for the map of San Francisco, California. The server sends back structured data in JSON format so you can build a map from it. This is basically how many of the applications we use on a daily basis interact. Do you happen to recognize any of these screenshots?

Alright, well that's enough for the simple HTTP introduction and how it may be used to build API's. The next lesson covers how to use the Amazon API Gateway to build and expose API's for other developers.