8 class CachedHttp : public Http {
10 CachedHttp(Http &http = Http::instance(), const char *name = "http");
11 void setMaxSeconds(uint seconds);
12 void setMaxSize(uint maxSize);
13 void setCachePostRequests(bool value) { cachePostRequests = value; }
14 QObject *request(const HttpRequest &req);
19 bool cachePostRequests;
22 class CachedHttpReply : public HttpReply {
26 CachedHttpReply(const QByteArray &body, const HttpRequest &req);
27 QUrl url() const { return req.url; }
28 int statusCode() const { return 200; }
29 QByteArray body() const;
35 const QByteArray bytes;
36 const HttpRequest &req;
39 class WrappedHttpReply : public QObject {
43 WrappedHttpReply(LocalCache *cache, const QByteArray &key, QObject *httpReply);
46 void data(const QByteArray &bytes);
47 void error(const QString &message);
48 void finished(const HttpReply &reply);
51 void originFinished(const HttpReply &reply);
59 #endif // CACHEDHTTP_H