1. Home
  2. Training Library
  3. Amazon Web Services
  4. Courses
  5. What is an API and How Do They Work?

A Quick Overview of HTTP and Internet Communication

Contents

keyboard_tab
A Quick Overview of HTTP and Internet Communication
Overview
Difficulty
Beginner
Duration
9m
Students
75
Ratings
5/5
starstarstarstarstar
Description

An API (Application Programming Interface) allows users or applications to interact with each other, making communication with the underlying service easier for both the service itself and the user calling it. This course covers the basics of what an API is, how it functions, and why you would want to use one.

Learning Objectives

  • Understand the basics of APIs
  • Learn about HTTP and internet communication
  • Understand the difference between HTTP and REST

Intended Audience

Solutions architects, developers, or anyone interested in learning about APIs.

Prerequisites

 A basic understanding of internet technology.

Transcript

Now that we know that an API is just a way to facilitate communication between a service and a user, we can begin to discuss the methods in which that can happen. 

Most communications over the internet is achieved through the use of the HyperText Transfer protocol or HTTP. It is a server-client protocol that allows you to fetch resources, such as documents, images, videos, scripts, and what have you over the internet.

HTTP follows the synchronous request and response model. This is a message exchange pattern where the requester sends a request message to a system, which receives and processes the request, and eventually will send back a response.

The HTTP protocol has many different methods you can use to communicate. Each of them tells the server what it should do with a particular request. 

Here is a list of every method, but the most common ones are: GET, POST, PUT, and DELETE.

The GET method allows you to request a specific piece of data from a server. This is what your browser uses to retrieve a webpage when you type in www.cloudacademy.com for example.

POST is a request to add new data to a server. This could be used to add a comment to a youtube video.

PUT is used to update some existing data - like editing that previous comment.

And DELETE is pretty self explanatory.

There are also rules for describing the responses from the server. Each response includes a numeric response code. The response codes help to tell the client how to handle the response. 

The codes are numbered between 100 to 500, and some are probably very familiar to you. 

For example, you are probably familiar with the 404 status code which is the server telling you that the thing you were looking for was not able to be found. You may also have seen the 200 status code which means everything went as expected.

Each different level of code, 200, 300, etc, has a different type of meaning. 200 responses generally mean everything went ok. 500 codes mean a server had a problem generating a response. 300s covers redirections, and the 400 range indicates there are problems with the request on the client's side.

About the Author
Avatar
Will Meadows
Senior Content Developer
Students
6079
Courses
31

William Meadows is a passionately curious human currently living in the Bay Area in California. His career has included working with lasers, teaching teenagers how to code, and creating classes about cloud technology that are taught all over the world. His dedication to completing goals and helping others is what brings meaning to his life. In his free time, he enjoys reading Reddit, playing video games, and writing books.