For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Postman
PricingEnterprise
Contact SalesSign InSign Up for Free
HomeDocs
HomeDocs
      • Overview
        • Overview
        • Install and sign in
        • Send requests
        • Add and manage certificates
        • Create and manage collections
        • Create and manage environments
        • Share your work and manage access
        • Document APIs
          • Overview
          • Write scripts
          • Use packages in scripts
          • Run collections
        • Manage Postman with AI agents
        • Feedback
Postman API Platform

Product

  • Postman Overview
  • Enterprise
  • Spec Hub
  • Flows
  • Agent Mode
  • API Catalog
  • Fern
  • Postman CLI
  • Integrations
  • Workspaces
  • Plans and pricing

API Network

  • App Security
  • Artificial Intelligence
  • Communication
  • Data Analytics
  • Database
  • Developer Productivity
  • DevOps
  • Ecommerce
  • eSignature
  • Financial Services
  • Payments
  • Travel

Resources

  • Postman Docs
  • Academy
  • Community
  • Templates
  • Intergalactic
  • Videos
  • MCP Servers

Legal and Security

  • Legal Terms Hub
  • Terms of Service
  • Postman Product Terms
  • Security
  • Website Terms of Use

Company

  • About
  • Careers and culture
  • Contact us
  • Partner program
  • Customer stories
  • Student programs
  • Press and media
Twitter iconLinkedIn iconGithub iconYouTube iconInstagram iconDiscord icon
Download Postman
Privacy Policy

© 2026 Postman, Inc.

On this page
  • Test your API using scripts
  • Edit scripts as a JavaScript file
ReferencePostman VS Code extensionTest APIs

Test APIs using the Postman VS Code extension

||View as Markdown|
Was this page helpful?
Previous

Test APIs using the Postman VS Code extension

Next

Reuse packages from the Postman VS Code extension

Built with

Use the Postman VS Code extension to test your API’s functionality. You can add pre-request and post-response scripts to your HTTP collections, folders, and requests. You can also open pre-request and post-response scripts as a JavaScript file, giving you the full editing experience of your code editor.

You can add common tests to your team’s Postman Package Library and reuse them in internal workspaces.

Test your API using scripts

You can add post-response scripts to HTTP collections, folders, and requests that run after a response is received. Add tests to confirm that your API is working as expected and help you debug your API if something goes wrong. Postman supports post-response scripts written in JavaScript.

To add post-response scripts, do the following:

  1. Select an HTTP request, folder, or collection.

    To learn more about testing collections and folders, see Test collections and folders.

  2. Select Scripts > Post-response and add tests. You can add your own post-response scripts or snippets of commonly used test code. For test examples, see Postman test script examples.

  3. Optionally, you can add log statements to your post-response scripts to help you debug your requests in the Postman Console.

  4. Click Send to run your request.

The tests run after a response is received. In the Response section, click the Test Results tab to review the results of your tests.

To learn more about writing tests scripts in Postman, see Write scripts to test API response data in Postman.

Edit scripts as a JavaScript file

You can open pre-request and post-response scripts as a JavaScript file in the application you’re using to develop your APIs. Get the full editing experience of your code editor while you write test and scripts for your HTTP requests, folders, and collections. This also enables you to leverage your application’s AI agent, such as GitHub Copilot, to help you write and edit your tests and scripts.

  1. Open an HTTP request, folder, or collection you’d like to add tests or scripts to.
  2. Click the Scripts tab, and then select the Pre-request or Post-response tab.
  3. Click Open web icon Open in native editor in the upper right of the code editor. A JavaScript file opens in a new tab.
  4. Write and edit your test and scripts in the file. Changes to the file are synced to your script in real time.
  5. Save the file to preserve your changes.