Skip to content

Commit 30860f9

Browse files
committed
Added more info, still WIP
1 parent 42382b6 commit 30860f9

File tree

1 file changed

+153
-39
lines changed

1 file changed

+153
-39
lines changed

learning/dashboard/Group 4/Postman.md

Lines changed: 153 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<br>
44

5-
![Javatpoint](https://static.javatpoint.com/tutorial/postman/images/postman-tutorial.png)
5+
![](https://i.postimg.cc/G3NzwvKt/image-2023-04-14-172950620.png)
66

77
<br>
88

@@ -18,7 +18,7 @@ Postman is one of the most popular software testing tools which is used for API
1818
- Continuous integration: It can support continuous integration.
1919
- 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.
2020

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.
2222

2323
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.
2424
<br>
@@ -28,24 +28,25 @@ After completion of this tutorial, you will get a basic level of understanding o
2828

2929
<br>
3030

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+
3333
<br>
3434

3535
### Downloading and installing the native Postman application on Windows
3636

3737
<br>
3838

39-
* Go to this link (https://www.postman.com/downloads/) and click *Download* for Windows.<br><br>
40-
![Javatpoint]( https://static.javatpoint.com/tutorial/postman/images/postman-installation-and-updates.png)<br>
41-
*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>
40+
![](https://i.postimg.cc/HxGz8yZ3/image-2023-04-14-173433882.png)<br>
41+
*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>
4242

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>
44-
![Javatpoint](https://static.javatpoint.com/tutorial/postman/images/postman-installation-and-updates2.png)<br>
43+
* Once the .exe file is downloaded, you need to install the application. <br><br>
44+
![](https://i.postimg.cc/Z5fmFTp1/image-2023-04-14-174101132.png)<br>
4545
*It is preferable to create an account as this will help you to save the work you do within Postman, and with this, you won't lose any work.*
4646
<br>
4747
<br>
4848

49+
4950
### Downloading and installing the native Postman application on Linux (Ubuntu)
5051

5152
<br>
@@ -60,25 +61,27 @@ Alternatively, you can download and install it within the Snap Store's UI.
6061

6162
<br>
6263

63-
![](https://i.imgur.com/N6Svo2y.png)<br><br>
64+
![](https://i.postimg.cc/FR2PvhH6/image-2023-04-14-175939859.png)<br><br>
6465
Either way, this is the simplest method to install Postman on Linux/Ubuntu systems.
6566

6667
<br>
6768

6869
### Setting up Postman for proper usage on Linux and Windows
6970

70-
*While these screenshots were taken in Windows, the process henceforth will be the same in a Linux environment.*
71+
<br>
72+
73+
> *While these screenshots were taken in Windows, the process henceforth will be the same in a Linux environment.*
7174
7275
<br>
7376

7477
* Create your account with all the required details, or sign up with Google, as shown in the image.<br><br>
75-
![Javatpoint](https://i.imgur.com/UU6cI7m.png)
78+
![](https://i.postimg.cc/pXYpKkzh/image-2023-04-14-180114098.png)
7679

7780
* After signing in, select the workspace tools as per your requirement, and then click on, continue to get the startup screen.<br><br>
78-
![Javatpoint](https://static.javatpoint.com/tutorial/postman/images/postman-installation-and-updates5.png)
81+
![](https://i.postimg.cc/Z5gr9Vrk/image.png)
7982

8083
* You will see the following page, and then you are ready to use Postman.<br><br>
81-
![Javatpoint](https://static.javatpoint.com/tutorial/postman/images/postman-installation-and-updates6.png)
84+
![](https://i.postimg.cc/L8CMjZXF/image-2023-04-14-180739584.png)
8285
<br>
8386
<br>
8487

@@ -89,10 +92,10 @@ Either way, this is the simplest method to install Postman on Linux/Ubuntu syste
8992
* You will receive a notification in your Postman app if any update is available.
9093

9194
* To download or install the latest update, click on the *Settings* icon, as shown in the image below, then go to *Update*.<br><br>
92-
![Javatpoint](https://static.javatpoint.com/tutorial/postman/images/postman-installation-and-updates7.png)
95+
![](https://i.postimg.cc/DfCbNxm9/image.png)
9396

94-
* You can change the update settings by enabling the *Automatically download major updates* setting, as shown in the image below<br><br>
95-
![Javatpoint](https://static.javatpoint.com/tutorial/postman/images/postman-installation-and-updates8.png)
97+
* You can change the update settings by enabling the *Automatically download major updates* setting, as shown in the image below.<br><br>
98+
![](https://i.postimg.cc/ydLWwN6m/image.png)
9699

97100
* You can also check for the latest updates by clicking on *Check for updates*, which will show you if any new update is available.
98101

@@ -106,31 +109,148 @@ Either way, this is the simplest method to install Postman on Linux/Ubuntu syste
106109

107110
<br>
108111

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.
110117
111-
The following steps will show you how to use Postman after properly installing and setting it up.
118+
<br>
112119

113-
1. Open your Postman desktop application<br><br>
114-
![](https://i.imgur.com/LRI7l6I.png)
120+
1. Open your Postman desktop application.
115121

116-
2. Open Postman and select *Workspaces*<br><br>
117-
![](https://i.imgur.com/JFzKUuq.png)
122+
2. Open Postman and select *Workspaces*.<br><br>
123+
![](https://i.postimg.cc/tg9Y4cTC/image-2023-04-14-181343781.png)
118124

119-
3. In the workspace section section, click on *New*<br><br>
120-
![](https://i.imgur.com/mRfSIc4.png)
125+
3. In the workspace section section, click on *New*.<br><br>
126+
![](https://i.postimg.cc/5Nx4vzJn/image-2023-04-14-181442008.png)
121127

122-
4. After that, you will be greeted by a dialog box as seen below, click on *HTTP Request*<br><br>
123-
![](https://i.imgur.com/1wAT25e.png)
128+
4. After that, you will be greeted by a dialog box as seen below, click on *HTTP Request*.<br><br>
129+
![](https://i.postimg.cc/m2zs7yq3/image-2023-04-14-181637506.png)
124130

125131
5. You will see an input box in the *GET* section as highlighted below, you will have to put your API key or JSON in this box.<br><br>
126-
![](https://i.imgur.com/sRVBSoL.png)<br><br>
127-
Then all you need to do is press the *Send* button
132+
![](https://i.postimg.cc/Kc79wkTX/image-2023-04-14-181725497.png)
133+
*As you can see here we've used a JSON from a [crowdsourced database that tracked the coronavirus in India](https://data.covid19india.org).*<br><br>
134+
Then all you need to do is press the *Send* button.
128135

129-
6. You will then be greeted with the following json response message, typically look for *200 OK* for a successful response<br><br>
130-
![](https://i.imgur.com/ZapU4PC.png)
136+
6. You will then be greeted with the following json response message, typically look for *200 OK* for a successful response.<br><br>
137+
![](https://i.postimg.cc/V6fSNVKW/image-2023-04-14-181804701.png)
131138

132139
<br>
133-
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>
156+
![](https://i.postimg.cc/xdTKBJF9/image-2023-04-15-183439091.png)<br><br>
157+
158+
- 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>
159+
![](https://i.postimg.cc/8zNcndJ0/image-2023-04-15-181839594.png)
160+
![](https://i.postimg.cc/kMVDzXjW/image-2023-04-15-182657120.png)<br><br>
161+
162+
- On the left pane of your Postman window, click on *New*. <br><br>
163+
![](https://i.postimg.cc/gkpKzYY5/image-2023-04-15-184331801.png)<br><br>
164+
- Then click on *HTTP Request*. <br><br>
165+
![](https://i.postimg.cc/x8vXCJv4/image-2023-04-15-184851721.png)<br><br>
166+
167+
This will make an untitled HTTP request as seen below. <br><br>
168+
![](https://i.postimg.cc/j5Z7QJwn/image-2023-04-15-185020949.png)<br><br>
169+
170+
### Collections
171+
To give your request a proper title you will have to save it to a collection, which is nothing but a compilation of requests.
172+
173+
- Click the *Save* button in the top-right corner. <br><br>
174+
![](https://i.postimg.cc/j5qFX54n/image-2023-04-15-190016719.png) <br><br>
175+
- 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>
176+
![](https://i.postimg.cc/kMZN54zM/image-2023-04-15-190352931.png) <br><br>
177+
- Give your collection a name. <br><br>
178+
![](https://i.postimg.cc/fTT5rLpM/image-2023-04-15-190902284.png)
179+
> Note that you can also do this by clicking the Collections tab, then clicking the '+' icon and renaming it if you wish
180+
- You can now save your request to your newly created collection. <br><br>
181+
![](https://i.postimg.cc/B6cZXsTn/image-2023-04-15-191211558.png)
182+
![](https://i.postimg.cc/SNjTtVsS/image-2023-04-16-185153973.png) <br><br>
183+
- 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>
184+
![](https://i.postimg.cc/527XZhqY/image-2023-04-15-200119592.png) <br><br>
185+
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>
207+
![](https://i.postimg.cc/DyjZ7fnQ/image-2023-04-16-185429831.png)
208+
*Notice the* Status: 200 OK *message*
209+
210+
> 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>
220+
![](https://i.postimg.cc/CM2HqHs9/image-2023-04-16-211324491.png)
221+
![](https://i.postimg.cc/D0W2bKPJ/image-2023-04-16-211646429.png) <br><br>
222+
223+
- Specify the name and scope of your variable. <br><br>
224+
![](https://i.postimg.cc/vTd99H64/image-2023-04-16-221248025.png) <br><br>
225+
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>
238+
![](https://i.postimg.cc/DzRhZVkp/image-2023-04-16-220916216.png) <br><br>
239+
240+
- 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>
241+
![](https://i.postimg.cc/q7tx3xLq/image-2023-04-16-222645809.png) <br><br>
242+
243+
Now that the request URL is a little easier to read, let's use another endpoint with the `GET` method.
244+
245+
- The `books` endpoint will return a list of books <br><br>
246+
![](https://i.postimg.cc/XJPf7GFF/image-2023-04-16-223022815.png) <br><br>
247+
248+
> *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>
253+
![](https://i.postimg.cc/MKz6pW03/image-2023-04-16-225327088.png)
134254

135255
<br>
136256
<br>
@@ -146,11 +266,5 @@ Provided you followed all the above steps properly, you have now successfully us
146266
- https://en.wikipedia.org/wiki/Postman_(software)
147267
- https://github.com/postmanlabs
148268

269+
All the images used in this documentation are sourced from: https://postimg.cc/gallery/qdxZs8Q
149270

150-
151-
152-
153-
154-
155-
156-

0 commit comments

Comments
 (0)