KnowledgeCity

Request and Response

It’s important to understand the concept of requests and responses in order to learn REST comprehensively.

It’s important to understand the concept of requests and responses in order to learn REST comprehensively. With the advent of sophisticated and comprehensive API documentation, as well as powerful client-side tools, developing a REST API client has never been easier. There are many software tools available to develop, test, and document APIs, but the most widely used software product for API client development and testing is Postman. Acquiring an expert level of knowledge with Postman (or similar tools) is an essential skill for any API client developer. These lessons will introduce Postman and some of its most useful features.

Using Postman, you will learn how to issue requests to REST APIs using a variety of HTTP methods. You will also learn how to read and understand the responses received from requests as they appear in Postman. In addition, you will see how existing APIs may be imported into Postman using standard metadata, which automatically creates request objects that can be edited, stored, and shared.

Learning Objectives:

  • Navigate through the various functions provided by Postman
  • Describe the core elements of well-formed REST API requests
  • Understand the components of REST API responses and how they may be analyzed using Postman
  • Understand how write requests send request bodies to REST APIs 

Author: Josh Guardino

Duration: 16m · 3 lessons
Level: Beginner
Language: English

Skills you’ll gain

Advanced Rest ClientAPI GatewayPostman API PlatformREST API DevelopmentRest ClientRESTful API

What You'll Learn

  • Navigate the various functions provided by Postman
  • Describe the core elements of well-formed REST API requests
  • Issue requests to REST APIs using a variety of HTTP methods
  • Analyze HTTP requests and read responses as they appear in Postman
  • Understand how write requests send request bodies to REST APIs
  • Import existing APIs into Postman using standard metadata to auto-create editable request objects

Key Takeaways

  • Understanding the concept of requests and responses is essential to learning REST comprehensively.
  • Postman is the most widely used software product for API client development and testing.
  • Acquiring expert-level knowledge with Postman or similar tools is an essential skill for any API client developer.
  • Existing APIs can be imported into Postman using standard metadata, which automatically creates request objects that can be edited, stored, and shared.
  • Postman lets you issue requests using a variety of HTTP methods and read the responses they return.

Frequently Asked Questions

Who is this course for?

It is for API client developers, for whom acquiring an expert level of knowledge with Postman or similar tools is an essential skill.

What does this course cover?

It introduces Postman and some of its most useful features, and covers issuing requests to REST APIs using a variety of HTTP methods, reading and understanding the responses received, and importing existing APIs into Postman using standard metadata.

What skills will I gain?

You will learn to navigate Postman's functions, describe the core elements of well-formed REST API requests, understand and analyze REST API responses in Postman, and understand how write requests send request bodies to REST APIs.

What tool does the course focus on?

It focuses on Postman, described as the most widely used software product for API client development and testing, while noting that similar tools exist.

What lessons are included?

The course includes three lessons: HTTP Requests and Responses, Analyze HTTP Requests, and Receiving Responses.

Transcript

Show transcript (free preview lesson)

Transcript of the free preview lesson. Remaining lessons unlock with the full course.

Hello, my name is Josh Guardino. And in these lessons, you will learn about HTTP requests and responses sent to and received from a REST API, including the Postman tool. This is the Postman website, www.postman.com. Postman is a powerful all-in-one tool for building, developing, testing and deploying APIs. Postman offers API tools and API repository, workspaces and other services, such as governance for APIs. Let's take a look at the API tools that Postman offers. The API tools are accessed in the Postman application. This is an API client piece of software that you download and install on your computer. It also can run in a web browser. Postman is much more than just an API client. It allows you to design, document and test REST and other types of APIs. But let's focus on the API client. You will want to sign up on the Postman website, create an account and then download and install the software. And here is the Postman application running on my computer. Postman allows you to create API requests and group them by collections. It is also possible to create and import existing APIs. So let's import the Department of Motor Vehicles API. We'll click Import and then click Link. Back here at the API, I can click this link which contains a large JSON object containing the entire set of request types. I'll copy this URL and then paste it here in the URL field and click Continue. Postman automatically detected my Department of Motor Vehicles API. And I'll click Import. The API has now been successfully imported. And it appears on the left side. If I click the arrow, I will see the definition of the API, which includes the raw JSON that defines the API itself as well as all of our familiar endpoints underneath v1, for example, drivers and its GET, POST, PUT and PATCH methods and the driver slash ID with its GET and DELETE methods. So let's click on the Get all drivers request. It is possible to create these requests individually, so I am not restricted to the requests that were included in the import. You'll also notice in the URL that baseUrl has automatically been inserted. Anytime that you see a value with the double curly braces in Postman, this indicates that it is an environment variable that will be substituted when the request is run. The baseUrl has automatically been set to access my local API. Let's click Send. And the response received from the server contains all of the driver objects in JSON format. Postman automatically formats the response using indentation and color coding to make the response very easy to read. This response could also be viewed in its raw form and copied for use elsewhere. It is also possible to search within the results for a specific string or pattern. The icons along the right side are also very useful. This one shows us documentation about the request. And this code icon will show us the curl command. Now let's go over to the left side and click Collections. Collections contain API endpoint requests grouped together by any category that you wish. These requests function in the same manner as our automatically generated API requests. In fact, it would be possible to take this entire API and move it over to a collection. Collections are important artifacts. Because they are exportable, they can be packaged and shared with other users. Another important component of the Postman tool is the console window. The console window will include information about previous requests. For example, the previous request to retrieve details for a specific driver is shown here. Clicking the arrow displays important information about the request itself. And the request body can be viewed by just clicking this arrow here. Therefore, the console is a very important part of Postman and is incredibly useful, especially when encountering errors or unexpected responses from APIs. Postman also includes many display-oriented features, such as the ability to pop a window out, easily copy what is in the window and filter data as well. The Postman tool contains a great many number of other features. And I encourage you to take time to look through all of the features, both in the tool and on the Postman website. Thanks for watching. Stay tuned for the next lesson where I will show you HTTP requests in more detail.

Learn on the Go

Take your learning anywhere — the KnowledgeCity mobile app lets you watch lessons on the go.