solusipse/ureq
FreeMicro C library for handling HTTP requests on low resource systems.
FreeFree tier
About solusipse/ureq
ureq is a lightweight, micro C library designed for handling HTTP requests on low resource systems, particularly embedded systems like the ESP8266. It acts as a middleware between a TCP server and an application, enabling URL dispatching to handler functions. The library supports basic HTTP methods (GET, POST, PUT, DELETE, and a catch-all UREQ_ALL) and is built with RESTful principles in mind. It is ideal for scenarios where sophisticated HTTP features are unnecessary, and system resources are severely constrained. Despite being in active development, it has proven stable in testing and the user-facing API is expected to remain consistent.
Key Features
URL dispatching to handler functions via ureq_serve()
Support for HTTP methods: GET, POST, PUT, DELETE, and UREQ_ALL
RESTful request handling
Designed for embedded systems with low resources (e.g., ESP8266)
Simple API returning string responses to clients
Optional access to HttpRequest struct for parsing GET parameters and POST data
Middleware architecture that integrates with any TCP server backend
Pros & Cons
Pros
- Extremely lightweight and minimal footprint
- Simple and intuitive API for URL dispatching
- Supports RESTful methods (GET, POST, PUT, DELETE)
- Stable in stability tests despite being in development
- Provides access to request data (e.g., GET parameters, POST body) when needed
- Open source with permissive license
Cons
- Still in heavy development, not yet feature-complete
- Limited to basic HTTP features; no support for advanced protocols like WebSockets or HTTPS
- Documentation noted as needing improvement (README draft)
- Not suitable for high-performance or production web servers
- Tightly integrated with raw TCP data; requires manual handling of TCP connection setup
Best For
Building lightweight HTTP servers on embedded microcontrollers (e.g., ESP8266)Creating simple REST APIs with minimal resource usagePrototyping HTTP services on IoT devicesReplacing heavier HTTP server libraries in resource-constrained environmentsEducational examples for learning HTTP server internals in C
FAQ
What is ureq?
ureq is a micro C library that sits between a TCP server and your application, dispatching URL requests to handler functions. It is designed for low-resource systems like embedded microcontrollers.
How do I use ureq?
You include 'ureq.h', define handler functions that return strings, register URLs with ureq_serve(), initialize an HttpRequest from a raw client request, then loop over ureq_run() to generate and send responses.
Is ureq RESTful?
Yes, the library understands RESTful principles and supports dispatching based on HTTP methods (GET, POST, PUT, DELETE).
What platforms is ureq intended for?
It is built for low-resource systems, especially embedded systems such as the ESP8266, or any environment where sophisticated HTTP features are not needed.
Is ureq production-ready?
The author notes that ureq is still in heavy development, but it behaves well in stability tests. The user-end interface is unlikely to change. It is probably suitable for simple, non-critical applications.