{"library":"reqwest","title":"Simple Asynchronous HTTP Client","description":"Reqwest is a browser-focused JavaScript library designed for making asynchronous HTTP requests, offering support for XMLHttpRequest, JSONP, CORS, and the CommonJS Promises/A specification. While it provided isomorphic capabilities allowing use in Node.js via the `xhr2` peer dependency, its primary intention and optimization were for client-side AJAX operations. The package is currently at version 2.0.5 and has not received any updates since August 2015. This effectively marks it as an abandoned project. Its Promise implementation adheres to an older specification (Promises/A), which may not be fully compatible with the ES2015+ Promises/A+ standard or modern `async/await` patterns. For contemporary JavaScript development, the native Fetch API or actively maintained alternatives like `axios` are generally preferred due to `reqwest`'s lack of ongoing support and potential compatibility issues with modern environments and security practices.","language":"javascript","status":"abandoned","last_verified":"Wed Apr 22","install":{"commands":["npm install reqwest"],"cli":null},"imports":["const reqwest = require('reqwest')"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"const reqwest = require('reqwest');\n\n// Example 1: Basic GET request with callback\nreqwest('https://jsonplaceholder.typicode.com/posts/1', function (resp) {\n  console.log('GET with callback response:', resp);\n});\n\n// Example 2: POST request with JSON data and Promises\nreqwest({\n    url: 'https://jsonplaceholder.typicode.com/posts',\n    method: 'post',\n    type: 'json',\n    contentType: 'application/json',\n    data: JSON.stringify({ title: 'foo', body: 'bar', userId: 1 }),\n    headers: {\n        'X-Custom-Header': 'MyValue'\n    }\n})\n.then(function (resp) {\n  console.log('POST with Promise success:', resp);\n})\n.fail(function (err, msg) {\n  console.error('POST with Promise error:', err, msg);\n})\n.always(function () {\n  console.log('POST request completed (always).');\n});\n\n// Example 3: JSONP request (assuming a JSONP endpoint like 'https://example.com/data.jsonp?callback=?')\n// For demonstration, this won't run without a live JSONP service.\nreqwest({\n    url: 'https://httpbin.org/jsonp?callback=?', // Using a placeholder for demonstration\n    type: 'jsonp',\n    jsonpCallback: 'callback',\n    success: function (resp) {\n        console.log('JSONP request successful:', resp);\n    },\n    error: function (err) {\n        console.error('JSONP request failed:', err);\n    }\n});","lang":"javascript","description":"Demonstrates `reqwest` usage for simple GET requests with callbacks, POST requests with JSON data and promises, and a placeholder for JSONP.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}