Skip to content

Latest commit

 

History

History
28 lines (16 loc) · 950 Bytes

GenerateCode.md

File metadata and controls

28 lines (16 loc) · 950 Bytes

Code generation with Postman

Postman lets you generate code in up to 15 languages.

Simply select a REST request in your collection, and click on the Code link, right under the Save button.

click on code link

As the code generation popup opens, pick your favorite language from the combo.

pick a language

Check the code generated by postman.

As an example:

  • import the "all-resources-scripted" collection,
  • expand the Rooms resource folder,
  • select the List Rooms request,
  • click the Code link

Here is the code you'll get if you ask postman to generate a nodejs/request code snippet:

nodejs snippet example

Note that if you look at it carefully, you'll notice the extra header "postman-token". This header you need to remove manually as you'll copy paste into your application code.