How to export specific request to file using postman?

RestPostmanWebapi

Rest Problem Overview


I want to export one specific request from a Postman extension (Chromium) and send it to another developer so that they can import it. How I can do this?

Rest Solutions


Solution 1 - Rest

To do that you need to leverage the "Collections" feature of Postman. This link could help you: https://learning.getpostman.com/docs/postman/collections/creating_collections/

Here is the way to do it:

  • Create a collection (within tab "Collections")
  • Execute your request
  • Add the request to a collection
  • Share your collection as a file

Solution 2 - Rest

  1. Click on the "Code" button upright of the request page.
  2. From the opened window select cURL.
  3. Copy and share the generated code.

enter image description here

You can use this curl request to import it into Postman.

> This discards variables, pre-request scripts, tests... or anything > Postman-specific the request has.

Solution 3 - Rest

If you want to export it as a file just do Any Collection (...) -> Export. There you should be able to choose collection version format and it will be exported in JSN file.

Solution 4 - Rest

in the new version of the postman, this way work for me press on code simple in right of a screen then Code snippet extends

enter image description here

Then you can choose which language format you are interested in

enter image description here

Solution 5 - Rest

Thanks to the previous answers you knew how to save/download a request.

For people who are asking for a way to save/export the response you can use the arrow beside the "Send" button, click "Send and Download" to get the response in .json

enter image description here

Solution 6 - Rest

There is no direct option to export a single request from Postman.

You can create and export collections. Here is a link to help with that.

Regarding the single request thing, you can try a workaround. I tried with the RAW body parameters and it worked.

What you can do is,

  1. In your request tab, click on the 3 dots in the top right corner of your request panel/box. enter image description here

  2. Select Code. This will open Generate Code Snippents window. enter image description here

  3. Copy the cURL code and save it in a text file. Share this with who you want to. enter image description here

  4. They can then import the request from the text file. enter image description here

Solution 7 - Rest

You can export collection by clicking on arrow button

enter image description here

and then click on download collection button

Solution 8 - Rest

The workaround is to export the collection as explained in other answers or references. This will export all requests in that collection to JSON file.

Then edit the JSON file to remove the requests you do not want using any editor; this is very simple.

Look for "item" collection in file. This contains all your requests; one in each item. Remove the items you do not want to keep.

If you import this edited file in Postman where original collection already exists, Postman will ask you if you want to replace it or create a copy. If you want to avoid this, you may consider changing "_postman_id" and "name" under "info". If original collection will not exist while importing edited collection, then this change is not needed.

Screenshot

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionSildView Question on Stackoverflow
Solution 1 - RestThierry TemplierView Answer on Stackoverflow
Solution 2 - RestSeyyedMojtabaView Answer on Stackoverflow
Solution 3 - RestmkoView Answer on Stackoverflow
Solution 4 - RestYoelView Answer on Stackoverflow
Solution 5 - RestSaif BadranView Answer on Stackoverflow
Solution 6 - RestIAmMilinPatelView Answer on Stackoverflow
Solution 7 - RestOmar MakledView Answer on Stackoverflow
Solution 8 - RestAmit JoshiView Answer on Stackoverflow