2 Getting set up to make API Requests

 

This chapter covers:

  • Introducing the FarmStall API and some of its business logic
  • Introducing a tool to make HTTP requests, Postman
  • Executing API Requests and inspecting the Responses

We have an API, but we have no idea if it works the way we expect. Before we get any further along with documenting it, we need to be able to test it. In this chapter we’ll be looking at how to use Postman to make HTTP Requests against our newly adopted API. We’ll be verifying that we get "decent looking" Responses from our Requests.

We also want to learn a bit about the business domain of the API, so that we have an understanding of what we’re doing, when we interact with the API itself.

What we’ll be touching on

2.1  The problem

Our first problem, is that we haven’t yet successfully interacted with the API. So we don’t know if there are any issues that prevent us from using it. To solve that we need to make at least one successful HTTP request against the FarmStall API, to ensure that all the moving parts are in order. Lets grab the Quick Start section of the FarmStall API project, to see what the original developers wrote.

After some rummaging, we find this:

2.2  Getting set up with Postman

 

2.2.1  Installing Postman

 
 

2.3  FarmStall API

 
 
 
 

2.4  Our first request!

 
 

2.4.1  Forming the Request in Postman

 

2.4.2  Verification

 
 
 

2.5  Adding a Review to the FarmStall API

 
 
 

2.5.1  Verification

 
 

2.6  Practice

 
 

2.6.1  Fun API requests to make

 
 
 

2.7  Summary

 
 
 
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage
test yourself with a liveTest