You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -18,7 +18,7 @@ Postman is one of the most popular software testing tools which is used for API
18
18
- Continuous integration: It can support continuous integration.
19
19
- Application development: Accelerated application development with Postman eliminates dependencies and reduces the time taken by production by having the frontend and backend teams work in parallel.
20
20
21
-
This tutorial is created for those who would like to learn the basics of Postman. As the number of web and mobile applications is increasing, the importance of API testing is also growing. So this tutorial will help you to learn postman testing for testing APIs.
21
+
This tutorial was created for those who would like to learn the basics of Postman. As the number of web and mobile applications is increasing, the importance of API testing is also growing. So this tutorial will help you to learn postman testing for testing APIs.
22
22
23
23
After completion of this tutorial, you will get a basic level of understanding of Postman and API testing. This tutorial will also give you a good understanding of how to use Postman to execute APIs for any given URL for your daily work.
24
24
<br>
@@ -28,24 +28,25 @@ After completion of this tutorial, you will get a basic level of understanding o
28
28
29
29
<br>
30
30
31
-
Postman can be downloaded for all major operating systems, including Mac, Linux, and Windows, as a native app (standalone application). Postman is also available as a chrome extension application, but it is preferable to install and use the native desktop app because the extension does not support all the features that the native app has.
32
-
<br>
31
+
> Postman can be downloaded for all major operating systems, including Mac, Linux, and Windows, as a native app (standalone application). Postman is also available as a chrome extension application, but it is preferable to install and use the native desktop app because the extension does not support all the features that the native app has.
32
+
33
33
<br>
34
34
35
35
### Downloading and installing the native Postman application on Windows
36
36
37
37
<br>
38
38
39
-
* Go to this link(https://www.postman.com/downloads/) and click *Download* for Windows.<br><br>
*For downloading the app for Windows, click on the download button and select the particular version. If you are using a 32-bit OS, you can choose the 32 bit option instead.*
39
+
* Go to [this link](https://www.postman.com/downloads/) and click *Download* for Windows.<br><br>
*For downloading the app for Windows, click on the download button and select the particular version. If you are using a 32-bit OS, you can choose the 32 bit option instead.* <br><br>
42
42
43
-
*You can check the download progress on the bottom left if you are using the Chrome browser. Once the .exe file is downloaded, you need to install the application, as shown in the below image.<br><br>
* You can change the update settings by enabling the *Automatically download major updates* setting, as shown in the image below.<br><br>
98
+

96
99
97
100
* You can also check for the latest updates by clicking on *Check for updates*, which will show you if any new update is available.
98
101
@@ -106,31 +109,148 @@ Either way, this is the simplest method to install Postman on Linux/Ubuntu syste
106
109
107
110
<br>
108
111
109
-
## Usage
112
+
## Basic Usage
113
+
114
+
<br>
115
+
116
+
> The following steps will show you how to use Postman after properly installing and setting it up. Consider this a trial run if you are using Postman for the first time.
110
117
111
-
The following steps will show you how to use Postman after properly installing and setting it up.
Provided you followed all the above steps properly, you have now successfully used Postman to get a postive response from an API.
140
+
Provided you followed all the above steps properly, you have now successfully used Postman to get a postive response from an API.
141
+
<br><br>
142
+
143
+
## Intermediate Usage and Further Information
144
+
145
+
<br>
146
+
147
+
> We will be using a [very simple API developed for books](https://github.com/vdespa/introduction-to-postman-course/blob/main/simple-books-api.md) for the following steps. This section will cover some slightly more advanced usage of Postman as well the explanation of endpoints, how variables work and environments.
148
+
149
+
<br>
150
+
151
+
### Workspaces
152
+
153
+
First off, you will need to create a workspace and get a request tab set up like earlier.
154
+
155
+
- Go to *Workspaces* and click on new *Create Workspace*. <br><br>
- Name your workspace and give it a meaningful summary. You can make your workspace personal, team-oriented, private, public or partner-oriented, but for now we'll just make it personal. <br><br>
- If this is your first time using Postman, you will likely not have any pre-existing collections to save your request to, so you will first have to make one. Click on *Create Collection*. <br><br>
- Now copy and paste the link to the source of the API you're using, which in this case is `https://simple-books-api.glitch.me` for the simple book API. <br><br>
This link, with the inclusion of any modifications made to it, is what's known as the **Request URL**.
186
+
187
+
<br>
188
+
189
+
### Request methods
190
+
Let us now discuss what that `GET` beside the request URL means. The nature of HTTP requests allows to specify the context in which you are interacting with the API, i.e., whether your request URL will serve primarily as a request to the API to recieve an input or produce an output and furthermore what kind of input to take or output to give. To that effect there are several *Request methods* in Postman. The most commonly used ones are:
191
+
192
+
1. GET
193
+
2. POST
194
+
3. PATCH
195
+
4. DELETE
196
+
197
+
In Postman any request you create will use the `GET` method by default. The `GET` method is used to retrieve information from the API. Requests using this method should only retrieve data and should have no other effect on the data. The usage of the other methods will be explained later on through the course of this tutorial.
198
+
199
+
<br>
200
+
201
+
### Endpoints
202
+
An endpoint is a URL pattern used to communicate with an API. It is essentially a way through which a user or an application can interact with other applications. For example, If you add `status` to the request URL to get `https://simple-books-api.glitch.me/status`, then that `status` you just added would become an endpoint for that link.
203
+
204
+
<br>
205
+
206
+
Adding the `status` endpoint to the request URL beforing hitting *Send* would give you this output: <br><br>
> Note that while some endpoints like `status` are common in most APIs, many more are specific to individual ones.
211
+
212
+
The request URL as it is right now might look a little complicated, but it is possible to simplify it a bit through the use of variables.
213
+
214
+
<br>
215
+
216
+
### Variables
217
+
Variables enable you to store and reuse values in Postman. By storing a value as a variable, you can reference it throughout your collections, environments and requests. Since `https://simple-books-api.glitch.me` is going to be a recurring base point for the Request URL, its value can simply be assigned to variable and reused later.
218
+
219
+
- Select the base URL and then click *Set as variable*, then click on *Set as new variable*. <br><br>
As you can see there are three ways you can go about this. <br><br>
226
+
227
+
> `Global` <br> If you set your variable's scope to *Global* it can be referenced across every collection, request and test case you make in Postman.
228
+
229
+
> `Environment` <br> If you set your variable's scope to *Active Environment*, it will referenced only in the currently active environment, more on this later.
230
+
231
+
> `Collection` <br> If you set your variable's scope to *Collection*, it will be referenced only within the collection you're creating the variable in.
232
+
233
+
<br>
234
+
235
+
- Choose *Collection* for now. *Global* would work similarly in this scenario though since you have made only one collection so far.
236
+
237
+
- If you click on your collection and then navigate to *Variables* you should be able to see your variable <br><br>
- Now replace `https://simple-books-api.glitch.me` in your request URL with the name you gave it in double curly braces, `{{base}}` in this case, and send the request again. It should work just as it did before. <br><br>
> *Query Parameters* <br> Query parameters are appended to the end of the request URL, following a '?' and are listed in key value pairs, separated by '&' using the following syntax: `?id=1&type=new`
249
+
250
+
<br>
251
+
252
+
- This API allows you to use the `type` parameter after the `books` endpoint to specify whether you want fiction or non-fiction books. You can implement this either by following the general syntax and typing `?type=(fiction/non-fiction)` after the rest of the request URL or by simply adding the parameter more intuitively into the table provided the *Params* tab under the request URL. <br><br>
0 commit comments