httpplease is a lightweight (under 2KB gzipped) HTTP request library designed for "isomorphic" JavaScript applications, enabling the same codebase to run in both Node.js and browser environments. It maintains a browser-driven focus, explicitly supporting older environments like IE9 for cross-domain requests via plugins. The library features a simple, yet powerful, plugin system for extending its core functionality, such as adding Promise support or handling specific browser limitations. The current stable version is 0.16.4. The package appears to be unmaintained as there haven't been new releases in a considerable time, and its GitHub repository doesn't show recent activity, suggesting a stalled development lifecycle.
npm install httppleaseVerified import paths — ran on the pinned version, not inferred.
Demonstrates a basic GET request using `httpplease.get` and shows how to create a custom instance with default options using `httpplease.defaults` for a more complex API interaction.
Consider migrating to a modern, actively maintained HTTP client library that provides better security, performance, and feature support for contemporary JavaScript environments.
For ESM projects, use `import httpplease from 'httpplease';` and ensure your build tools (e.g., Webpack, Rollup) are configured to handle CJS interoperability. In Node.js, if in an ESM context, consider `const httpplease = await import('httpplease');` or ensure your project's `package.json` `type` field is not set to `module` unless you explicitly configure CJS loading.To treat 404 responses as successful non-error outcomes, set `errorOn404: false` in your request options: `httpplease.get({url: 'http://example.com/missing', errorOn404: false}, (err, res) => { /* handle 404 in res */ });`For modern browser development, ensure you understand its underlying implementation (likely `XMLHttpRequest`) and any limitations this might impose compared to `fetch` or other contemporary solutions. Consider polyfills or other libraries for newer features.
Increase the `timeout` option in your request configuration or optimize the server response time. Example: `httpplease.get({url: 'http://example.com', timeout: 5000}, (err, res) => { if (err && err.name === 'Timeout') { console.error('Request timed out'); } });`Ensure you are importing `httpplease` as a default export or requiring it as the main module. If using a `<script>` tag, ensure the global `httpplease` object is correctly loaded. Example: `import httpplease from 'httpplease'; httpplease({method: 'GET', url: '...'});` or `const httpplease = require('httpplease'); httpplease({method: 'GET', url: '...'});`Verify that the `httpplease` standalone build script is correctly included in your HTML before your application code, and that no other script is overwriting the global `httpplease` variable.
If 404s are expected and should not be treated as errors, set `errorOn404: false` in your request options. This will make the 404 response appear in the success callback (`res`) instead of the error callback (`err`).
No dependency data recorded yet.