qs is a JavaScript library for parsing and stringifying URL query strings with support for nested objects, arrays, and custom formatting. It is designed as a drop-in replacement for Node.js's built-in querystring module but with enhanced security features, including protection against prototype pollution, configurable depth limits, and parameter/array size limits. The library exposes three main functions: `parse`, `stringify`, and `formats`, all accessible from the single entry point `lib/index.js`. Internally, it uses a side-channel pattern for cycle detection and overflow tracking, and implements a chunked UTF-8 encoder to handle surrogate pairs safely. The codebase is well-tested with an extensive suite of edge-case tests, and it is distributed as an npm package with browser builds via Browserify. Architecturally, qs is a focused, single-purpose library with a clean separation of concerns: parsing logic in `lib/parse.js`, serialization in `lib/stringify.js`, shared utilities in `lib/utils.js`, and formatting constants in `lib/formats.js`. It follows a functional style with option normalization functions that validate and fill defaults, making the API robust against misuse. The library has a long history (over a decade) and is widely adopted (nearly 9000 stars), but its maintenance shows signs of high release churn and legacy support burdens, including backporting fixes to older Node.js versions (>=0.6) and maintaining outdated packaging artifacts like `bower.json` and `component.json`. Despite these legacy concerns, the core code is well-crafted, security-conscious, and actively maintained with frequent releases and responsive issue triage.
The httr package is an R library for making HTTP requests. It provides functions for the main HTTP verbs (GET, POST, PUT, DELETE, PATCH, HEAD) and a generic VERB function for custom verbs. It includes comprehensive support for HTTP configuration (authentication, headers, cookies, proxies, timeouts, etc.) and OAuth 1.0 and 2.0 authentication. Responses are captured in a response object and can be accessed as raw bytes, text, or parsed into common formats (JSON, XML, HTML, etc.). The package also includes utilities for URL parsing and building, media type parsing, HTTP date handling, retry logic with exponential backoff, and HTTP caching. Note: This package is superseded by httr2 for new development, but is still maintained for CRAN compatibility.
The hyperlink library is a pure-Python implementation of immutable URLs, designed for correctness and compliance with RFC 3986 and RFC 3987. It provides two main classes: the low-level `URL` class, which requires explicit handling of encoding and decoding, and the high-level `DecodedURL` class, which automatically handles encoding and decoding for ease of use. The library supports parsing, manipulating, and unparsing URLs, including operations on query strings, path segments, and internationalized domain names (IDNA). It is designed to be a drop-in replacement for Twisted's URL type and is tested across a wide range of Python versions (2.6 to 3.9 and PyPy). The architecture centers around the `_url.py` module, which contains the core parsing logic, the `URL` and `DecodedURL` classes, and helper functions for encoding and decoding. The library also includes a compatibility module (`_socket.py`) that provides a cross-platform implementation of `inet_pton` for older Python versions, particularly on Windows. Testing is facilitated by hypothesis strategies in `hypothesis.py` for generating valid URL components. The library has minimal external dependencies, relying only on the `idna` package for IDNA support and conditionally on `typing` for older Python versions. It is well-maintained with a comprehensive test suite and continuous integration setup, though it continues to support legacy Python versions, which introduces some maintenance overhead.