Flavio Tordini
Http
A wrapper for the Qt Network Access API.
This is just a wrapper around Qt's QNetworkAccessManager and friends. It has a simpler, higher-level API and some functionality not found in Qt:
- Throttling (as required by many web APIs nowadays)
- Automatic retries
- User agent and request header defaults
- Partial requests
- Easier POST requests
- Read timeouts (don't let your requests get stuck forever). (now supported by Qt >= 5.15)
- Redirection support (now supported by Qt >= 5.6)
Http Design
This library uses the Proxy design pattern to modularize features and make it easy to add them and use them as needed. The main class is Http, which implements the base features of a HTTP client. More specialized classes are:
- CachedHttp, a simple disk-based cache
- ThrottledHttp, implements request throttling (aka limiting)
The constructor of these classes takes another Http instance for which they will act as a proxy. (See examples by clicking "Get extension"). Following this design you can create your own Http subclass. For example, a different caching mechanism, an event dispatcher, custom request logging, etc.
Http License
You can use this library under the MIT license and at your own risk. If you do, you're welcome contributing your changes and fixes.