Postman is a popular API testing tool that simplifies building, testing, and managing API requests. This guide offers 30 Postman MCQ questions and answers focused on creating and managing requests, using query parameters, headers, authentication, and variables. Perfect for developers and testers, these questions ensure a solid understanding of Postman essentials.
1. Creating and Managing Requests
What is a request in Postman? a) A user interface element b) A call to an API endpoint c) A function for debugging code d) A type of authentication method
Which HTTP method is used to retrieve data from an API? a) POST b) GET c) PUT d) DELETE
Where do you enter the API endpoint in Postman? a) Authorization tab b) Headers section c) URL bar d) Body section
How can you save a request in Postman? a) By adding it to a collection b) By bookmarking it c) By exporting it as a file d) By running it in a runner
What is the primary use of the Body tab in Postman? a) For entering request headers b) For specifying HTTP methods c) For adding data to requests d) For managing API endpoints
2. Using Query Parameters and Headers
What are query parameters used for in an API request? a) To send authentication details b) To modify the request endpoint c) To pass additional data to the server d) To control server response headers
How are query parameters appended to a URL in Postman? a) Using a semicolon (;) b) Using a colon (:) c) Using a question mark (?) followed by key-value pairs d) Using a hash (#)
What are headers in an API request? a) Server-side configuration files b) Key-value pairs containing metadata about the request c) Mandatory parts of the request body d) Random data used for debugging
Which header is commonly used for JSON data? a) Accept-Encoding b) Content-Type c) Authorization d) Cache-Control
How can you add multiple query parameters to a request in Postman? a) By separating them with a comma (,) b) By using the Postman Query Params section c) By adding them to the Headers section d) By specifying them in the Pre-request script
3. Authentication in Postman
Which of these is an authentication method in Postman? a) Basic Auth b) GraphQL c) SQL Injection d) JSON Auth
Where is the API key usually included in an API request? a) In the request body b) In the query parameters or headers c) In the URL domain d) In the response data
What is the primary function of OAuth 2.0? a) To debug requests b) To secure access by providing tokens c) To log API errors d) To store server configurations
In Basic Authentication, what is required? a) API token and public key b) Username and password c) Client ID and secret key d) Access token
What type of data is passed in a Bearer Token? a) API version number b) Encrypted user credentials c) User permissions metadata d) Encrypted authentication token
4. Building and Managing Collections
What is a collection in Postman? a) A group of test results b) A saved group of requests organized into folders c) A set of HTTP headers d) A plugin for Postman
Why use collections in Postman? a) To replace authentication b) To organize and manage related requests c) To export environment variables d) To debug server issues
How do you share a collection in Postman? a) By saving it locally b) By using the Share button and generating a link c) By copying it to the clipboard d) By attaching it in an email
What is the Postman Runner used for? a) To run collections in sequence b) To execute individual requests c) To manage API keys d) To track server logs
How can collections be exported in Postman? a) As a JSON file b) As an XML file c) As an HTML file d) As a YAML file
5. Introduction to Variables
What is a global variable in Postman? a) A variable shared across all requests and collections b) A variable stored locally on the server c) A variable specific to a single collection d) A variable that cannot be updated
Which variable is specific to a single collection in Postman? a) Global variable b) Collection variable c) Environment variable d) Random variable
What is an environment variable used for in Postman? a) To define file structures b) To store API keys or base URLs for different environments c) To debug request headers d) To manage API responses
How do you reference a variable in Postman? a) Using {{variable_name}} syntax b) Using [[variable_name]] syntax c) Using <variable_name> syntax d) Using %variable_name% syntax
Where can you define global variables in Postman? a) In the Collection tab b) In the Environment tab c) In the Globals tab d) In the Body tab
6. Using Pre-Request Scripts and Tests
What is a Pre-Request Script in Postman? a) A script that defines the server’s response b) A script that runs before a request is sent c) A test script for validating response data d) A script for managing headers
Which language is used for scripting in Postman? a) Python b) JavaScript c) Ruby d) PHP
What is a common use case for Pre-Request Scripts? a) Automating server configurations b) Setting dynamic variables or headers before a request c) Formatting API responses d) Validating response codes
What is a Test script in Postman? a) A script for simulating server errors b) A script for running multiple requests c) A script for validating API responses and logic d) A script for managing global variables
How can you check the response status code in a Postman test script? a) Using pm.response.to.have.status(code) b) Using console.log(status_code) c) Using pm.sendRequest(code) d) Using status(response)
Answers
QNo
Answer (Option with the text)
1
b) A call to an API endpoint
2
b) GET
3
c) URL bar
4
a) By adding it to a collection
5
c) For adding data to requests
6
c) To pass additional data to the server
7
c) Using a question mark (?) followed by key-value pairs
8
b) Key-value pairs containing metadata about the request
9
b) Content-Type
10
b) By using the Postman Query Params section
11
a) Basic Auth
12
b) In the query parameters or headers
13
b) To secure access by providing tokens
14
b) Username and password
15
d) Encrypted authentication token
16
b) A saved group of requests organized into folders
17
b) To organize and manage related requests
18
b) By using the Share button and generating a link
19
a) To run collections in sequence
20
a) As a JSON file
21
a) A variable shared across all requests and collections
22
b) Collection variable
23
b) To store API keys or base URLs for different environments
24
a) Using {{variable_name}} syntax
25
c) In the Globals tab
26
b) A script that runs before a request is sent
27
b) JavaScript
28
b) Setting dynamic variables or headers before a request
29
c) A script for validating API responses and logic