{"library":"postman-request","title":"Postman Request Client","description":"Postman-request is a maintained fork of the popular, now-abandoned `request` module, specifically developed and used internally by Postman Runtime. Currently at version 2.88.1-postman.48, it does not follow a typical open-source release cadence but is updated as needed for Postman's internal applications. This package provides a simplified API for making HTTP requests, addressing numerous long-standing bugs and adding specific features that were never incorporated into the original `request` project. Key differentiators include fixes for old-style deflate responses, correct URL parameter encoding, enhanced redirect behaviors (especially for 307/308 with Host headers), `content-length` for streaming, improved form-data exception handling, and features like retaining authorization headers on cross-domain redirects and support for extending root CA certificates. It aims to offer a stable and patched alternative for projects still reliant on the `request` API.","language":"javascript","status":"active","last_verified":"Tue Apr 21","install":{"commands":["npm install postman-request"],"cli":null},"imports":["const request = require('postman-request');","const request = require('postman-request');\nrequest.post('http://example.com/upload', { form: { key: 'value' } }, (error, response, body) => { /* ... */ });","const request = require('postman-request');\nconst defaultRequest = request.defaults({ headers: { 'User-Agent': 'my-app' } });"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"const request = require('postman-request');\n\nrequest('http://www.google.com', function (error, response, body) {\n  if (error) {\n    console.error('Error:', error);\n    return;\n  }\n  console.log('statusCode:', response && response.statusCode); // Print the response status code if a response was received\n  console.log('body length:', body ? body.length : 0); // Print the length of the Google homepage HTML\n});","lang":"javascript","description":"Demonstrates a basic GET request to Google, logging the error, status code, and response body length.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}