Which part of a Postman collection JSON file defines the requests included in the collection?
Think about where Postman groups requests and folders inside a collection.
The item array in a Postman collection JSON contains all requests and folders. The info object holds metadata about the collection, not requests. Events are for scripts, and variables store environment or collection variables.
Given this snippet of a Postman collection JSON, how many requests does the collection contain?
{
"info": {"name": "Sample Collection"},
"item": [
{"name": "Get Users", "request": {"method": "GET", "url": "https://api.example.com/users"}},
{"name": "Create User", "request": {"method": "POST", "url": "https://api.example.com/users"}}
]
}Count the number of objects inside the item array that have a request field.
There are two objects inside the item array, each with a request field, so the collection contains two requests.
In a Postman collection JSON, which key path correctly locates the HTTP method of the first request?
Remember that item is an array of requests or folders, and each request is inside an item element.
The item array holds requests. The first request is at item[0]. Its method is inside request.method. So the correct path is item[0].request.method.
Which assertion correctly verifies that a Postman collection JSON has exactly 3 requests?
const collection = {
item: [
{ request: {} },
{ request: {} },
{ request: {} }
]
};Check the exact key name that holds the requests array.
The requests are inside the item array. So checking collection.item.length equals 3 is correct. Other options use wrong keys.
Which HTTP method and endpoint combination correctly creates a new collection using the Postman API?
Creating a resource usually uses a specific HTTP method.
To create a new collection via Postman API, you send a POST request to https://api.getpostman.com/collections. GET retrieves, PUT updates, DELETE removes.