diff --git a/include/QHttpEngine/qhttpsocket.h b/include/QHttpEngine/qhttpsocket.h index 406dec5..a8d1d0f 100644 --- a/include/QHttpEngine/qhttpsocket.h +++ b/include/QHttpEngine/qhttpsocket.h @@ -139,6 +139,10 @@ public: enum { /// Request was successful OK = 200, + /// Request was successful and a resource was created + Created = 201, + /// Request was accepted for processing, not completed yet. + Accepted = 202, /// Range request was successful PartialContent = 206, /// Resource has moved permanently @@ -155,8 +159,16 @@ public: NotFound = 404, /// Method is not valid for the resource MethodNotAllowed = 405, + /// The request could not be completed due to a conflict with the current state of the resource + Conflict = 409, /// An internal server error occurred - InternalServerError = 500 + InternalServerError = 500, + /// Invalid response from server while acting as a gateway + BadGateway = 502, + /// Server unable to handle request due to overload + ServiceUnavailable = 503, + /// Server does not supports the HTTP version in the request + HttpVersionNotSupported = 505 }; /** diff --git a/src/qhttpsocket.cpp b/src/qhttpsocket.cpp index ae26ba9..19780dd 100644 --- a/src/qhttpsocket.cpp +++ b/src/qhttpsocket.cpp @@ -75,6 +75,8 @@ QByteArray QHttpSocketPrivate::statusReason(int statusCode) const { switch (statusCode) { case QHttpSocket::OK: return "OK"; + case QHttpSocket::Created: return "CREATED"; + case QHttpSocket::Accepted: return "ACCEPTED"; case QHttpSocket::PartialContent: return "PARTIAL CONTENT"; case QHttpSocket::MovedPermanently: return "MOVED PERMANENTLY"; case QHttpSocket::Found: return "FOUND"; @@ -83,7 +85,11 @@ QByteArray QHttpSocketPrivate::statusReason(int statusCode) const case QHttpSocket::Forbidden: return "FORBIDDEN"; case QHttpSocket::NotFound: return "NOT FOUND"; case QHttpSocket::MethodNotAllowed: return "METHOD NOT ALLOWED"; + case QHttpSocket::Conflict: return "CONFLICT"; + case QHttpSocket::BadGateway: return "BAD GATEWAY"; + case QHttpSocket::ServiceUnavailable: return "SERVICE UNAVAILABLE"; case QHttpSocket::InternalServerError: return "INTERNAL SERVER ERROR"; + case QHttpSocket::HttpVersionNotSupported: return "HTTP VERSION NOT SUPPORTED"; default: return "UNKNOWN ERROR"; } }