

The resultant JSON file for collection will now contain the newly added request as well. For example, you add one more request to this collection and click export. #5) Export back the collection to JSON format (so that it can be shared with others). #4) You can now browse through the various requests that are available in the collection. Once the selection is complete, you can see that the JSON file gets imported as a Postman collection in the application.


You can simply download the JSON file using Curl command as below curl #1) To import a collection, download the above file and save it as a file to the file system. We will see how we can import this JSON file as a Postman collection in the application and export it back and share it as JSON. This is as good as a Postman collection exported to the Postman collection 2.1 format. If you download this file, you can see that it’s a file in JSON format. Similarly importing a collection is as simple as importing a JSON file that will show up as the request collection in your Postman application.įor the sake of illustration, we will use an already hosted collection here. It’s important to understand here that Postman collection can be exported as a JSON file and can be easily shared with someone with whom we intend to. First, let’s create a sample Postman collection in Postman with say 4-5 requests. Now let’s see how we can actually import or export a Postman collection in Postman. #3) To add new requests to the collection, click on Collection and click Add requests (please note it’s also possible to create a request first and then add it to the collection as well as moving in requests from one collection to another). Here is how you can create an empty collection and add multiple requests as a part of the same collection:
#POSTMAN DOWNLOAD ENTIRE CODE#
For example, if you need to check the status code for each request in the collection as HTTP 200, then instead of adding this test to all the individual requests, you can simply add it all at the collection level and it would apply to all requests when the collection is executed.

#4) Execute common tests for all requests belonging to a collection. #3) Collections can be shared with other users as JSON or through URLs as hosted collections on the Postman provided server. For example, instead of individually adding headers to each request, you can simply apply headers to all requests within that Postman collection using pre-request scripts or authorization headers. #2) Have collection level variables set that can apply to all requests within that collection. Then, it makes sense to organize them in a collection that would make things like applying collection variables, import/export easier and could be run as part of a single collection. Collections play an important role in organizing requests belonging to the same application etc.įor example, if you are testing or validating a restful API that has 10 endpoints. In simple terms, its an aggregation of Postman requests. Postman collection is nothing but a container or folder for storing Postman requests. Exporting/Importing A Postman Collection.
