Dave Westerveld helps you get started with using Postman for some basic API exploration.
- [Instructor] This course isn't about any particular API testing tool, but if we want to test APIs, we're going to need to use a tool that will let us easily send and receive commands to the APIs that we're testing. So for this course, we won't necessarily stick to just talking about one tool, but I did want to introduce you to Postman as one of the tools that we use. Postman is a very intuitive and easy to use tool when it comes to API testing. It's free to use and it has a large active user base, so there's many resources if you find yourself Googling for answers. So you can see here I've got getpostman.com open and this is where you can go.
You can download it and follow the installation instructions to set it up. And once you've done that, you can just open Postman and get started right away. So this first splash screen gives you a bunch of information. For now let's just look at the Request example and we'll make a request name. We'll just call it test. And we'll create a collection. Let's just call it collection one for now. And we'll close that. So we've got a request here that sets up how we can interact with an API.
So if you remember, we have the verbs. So here's a list of verbs. And there's quite a big list here, but like I said, we're only going to consider get, post, put, and delete as the common ones that we use. And then here's your URL. So this is where you put in the URL resource. So we have our verb, we have our noun, and then once we have that we can just send it. And then there's a couple other things. So if you remember, when we do posting, we need to specify some parameters. So we can specify those in Postman here with the body.
And there's a couple different ways we can do it. We can either put in a key value pair. So if we had a parameter like username, we could put that in here and we could give it a value that we want to have as our username. Or we could also specify it using the raw format here. And we could put in some text or, quite commonly what we'll do is JSON. So if we wanted to specify it as JSON, we could do the same thing as we did earlier and we could put in username and then give it some value that we wanted it to have.
So if we wanted our username to be some kind of value we could give it that value. And then we could send that and Postman will take care of formatting that in the way that you need to send it as JSON to the server. So those are kind of the basic things that you're going to need. Another thing that you'll probably run into at some point in your testing is authorization. And Postman also makes that fairly easy and straightforward to interact with. So we can see here we've got this authorization tab and there's a bunch of different authorization options that we can choose from.
We'll talk a little bit more about some of these different options and how you can use them later on in the course. But for now, you can see that these options are here, they're available, and if you follow through and read through the documentation you can figure out some of those things as well if you really need to. So this is just a really quick overview of this tool. Like I said, this course isn't about Postman as such. It's about testing APIs. But it's difficult to test an API without a tool. So we'll use Postman in a few different videos throughout this course. So it would be good to download.
It would be good to get a little bit familiar with it and be able to use it at least in a basic way. So, I would suggest download it, poke around a bit, have some fun, and hopefully you'll find that this is a helpful first tool to get you started with API testing.
- Reviewing API terminology
- Mitigating risks related to testing APIs
- Mapping out the layout of an API
- API authorization and authentication
- Finding and using bearer tokens
- Testing GET, POST, PUT, and DELETE calls
- Using mocks, stubs, and fakes in API testing
- Testing microservices and the Internet of Things