lil-http is a minimalist, full-featured HTTP client designed specifically for browser environments. It provides a simple, callback-based API for making HTTP requests (GET, POST, PUT, DELETE, PATCH, HEAD) using XMLHttpRequest (XHR) under the hood. Currently at version 0.1.17, the library prioritizes a tiny footprint (3 KB uncompressed, 1 KB gzipped) and broad browser compatibility (down to IE9, Chrome 5, Firefox 3) rather than modern features like Promises or the Fetch API. Its key differentiators were its small size and straightforward XHR wrapper API during its active development phase. However, the project appears to be unmaintained, with no recent releases or updates, making it unsuitable for new projects in modern web development stacks.
npm install lil-httpVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates a basic GET request using the globally exposed `lil.http` object, showing how to include authentication and custom headers, and handle the callback-based response.
For new development, use the native `fetch` API or a modern HTTP client library that supports Promises (e.g., `axios`). If bound to XHR, consider wrapping `lil-http` calls in `Promise` constructors.
Ensure `lil-http` is only used in client-side browser code. For Node.js, use built-in `http`/`https` modules or a Node.js-compatible client like `axios` or `node-fetch`.
When possible, use CommonJS `require('lil-http')` in environments that support it (e.g., via a bundler like Webpack or Browserify). If relying on the global, be mindful of potential conflicts.Install via npm: `npm install lil-http`. Be aware that even through npm, the underlying library is old and unmaintained.
Ensure `<script src="path/to/http.js"></script>` is placed before any code attempting to use `lil.http`. Alternatively, if using a bundler, ensure `const http = require('lil-http');` is correctly used and bundled.Check the network tab in browser developer tools for more specific errors. Verify the target URL is correct and accessible. Review browser console for CORS related errors. If the issue is CORS, the server configuration needs to be adjusted to allow requests from your origin, or a proxy should be used.
Configure the server (`http://example.com`) to include the `Access-Control-Allow-Origin` header with your origin (`http://localhost:8080`) or `*` for all origins (less secure). For local development, a proxy server can be used to bypass CORS.
No dependency data recorded yet.