spotify/NFHTTP
FreeA cross platform C++ HTTP library that interfaces natively to other platforms.
FreeFree tier
About spotify/NFHTTP
NFHTTP is a cross-platform C++ HTTP framework developed at Spotify (2019-2022) that provides a native interface to system-level HTTP implementations on each platform. It features a layered architecture including Modification, Multi-Request, Caching, and Native layers to ensure consistent behavior and battery-efficient networking across iOS, macOS, Linux, Android, and Windows. The library leverages native frameworks (NSURLSession on Apple, curl on Linux/Android, WinHTTP on Windows) and includes predictable caching, request deduplication, and request/response modification hooks. It is open-source and was handed over to new maintainers in January 2023.
Key Features
Layered architecture: Modification, Multi-Request, Caching, Native layers
Native system-level HTTP interface integration (NSURLSession, curl, WinHTTP)
Consistent cross-platform caching layer with SQLite backend
Request and response modification hooks for custom behavior
Multi-request deduplication to avoid redundant network calls
Support for iOS 9.0+, macOS 10.11+, Linux (Ubuntu 14.04+), Android SDK r24+, Windows UWP
Built on CMake for easy integration into larger projects
Pros & Cons
Pros
- Leverages native system HTTP stacks for better battery life and performance
- Layered architecture allows flexible customization and extension
- Predictable, consistent caching layer across all supported platforms
- Open source with permissive license (likely MIT, but not explicitly stated in scraped content — based on GitHub presence)
- Supports wide range of platforms including mobile and desktop
Cons
- Discontinued by original developers (Spotify) as of January 2023, now community-maintained
- Windows support is in Alpha stage, Android support is in Beta
- Relies on multiple external dependencies (C++ REST SDK, curl, JSON for Modern C++, OpenSSL, SQLite, boost)
- Lack of active development from original team may lead to stagnation or compatibility issues
Best For
Cross-platform mobile and desktop applications requiring efficient HTTP communicationBattery-sensitive applications where native networking reduces power consumptionProjects needing consistent HTTP caching behavior across different operating systemsModular network stacks where request/response interception is needed
FAQ
What is NFHTTP?
NFHTTP is a cross-platform C++ HTTP framework originally developed at Spotify that uses native system-level HTTP interfaces for efficient networking. It provides a common C++ API with layered architecture including caching, request deduplication, and modification hooks.
Is NFHTTP still maintained?
NFHTTP was discontinued by Spotify in January 2023 and handed over to new maintainers. As of the last update on GitHub, the project is not actively maintained by Spotify but may receive community contributions.
What platforms are supported?
Supported platforms include iOS 9.0+, macOS 10.11+, Ubuntu 14.04+ Linux, Android SDK r24+, and Windows UWP. The underlying frameworks are NSURLSession (iOS/macOS), curl (Linux/Android), and WinHTTP (Windows).
What dependencies does NFHTTP require?
NFHTTP depends on C++ REST SDK, curl, JSON for Modern C++, OpenSSL, SQLite, and boost. It uses CMake for building and integration.