|
QDjango
|
The QDjangoHttpController class provides static methods for replying to HTTP requests. More...
#include <QDjangoHttpController.h>
Static Public Member Functions | |
| static bool | getBasicAuth (const QDjangoHttpRequest &request, QString &username, QString &password) |
| static QString | httpDateTime (const QDateTime &dt) |
| static QDateTime | httpDateTime (const QString &str) |
| static QDjangoHttpResponse * | serveAuthorizationRequired (const QDjangoHttpRequest &request, const QString &realm=QLatin1String("Secure Area")) |
| static QDjangoHttpResponse * | serveBadRequest (const QDjangoHttpRequest &request) |
| static QDjangoHttpResponse * | serveInternalServerError (const QDjangoHttpRequest &request) |
| static QDjangoHttpResponse * | serveNotFound (const QDjangoHttpRequest &request) |
| static QDjangoHttpResponse * | serveRedirect (const QDjangoHttpRequest &request, const QUrl &url, bool permanent=false) |
| static QDjangoHttpResponse * | serveStatic (const QDjangoHttpRequest &request, const QString &filePath, const QDateTime &expires=QDateTime()) |
The QDjangoHttpController class provides static methods for replying to HTTP requests.
|
static |
Extract basic credentials from an HTTP request.
Returns true if credentials were provider, false otherwise.
|
static |
Converts a QDateTime to an HTTP datetime string.
|
static |
Converts an HTTP datetime string to a QDateTime.
|
static |
Respond to an HTTP request with an authorization error.
| request | |
| realm |
|
static |
Respond to a malformed HTTP request.
| request |
|
static |
Respond to an HTTP request with an internal server error.
| request |
|
static |
Respond to an HTTP request with a not found error.
| request |
|
static |
Respond to an HTTP request with a redirect.
| request | |
| url | The URL to which the user is redirected. |
| permanent | Whether the redirect is permanent. |
|
static |
Respond to an HTTP request for a static file.
| request | |
| docPath | The path to the document, such that it can be opened using a QFile. |
| expires | An optional expiry date. |