Add more http status code
This commit is contained in:
@@ -139,6 +139,10 @@ public:
|
|||||||
enum {
|
enum {
|
||||||
/// Request was successful
|
/// Request was successful
|
||||||
OK = 200,
|
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
|
/// Range request was successful
|
||||||
PartialContent = 206,
|
PartialContent = 206,
|
||||||
/// Resource has moved permanently
|
/// Resource has moved permanently
|
||||||
@@ -155,8 +159,16 @@ public:
|
|||||||
NotFound = 404,
|
NotFound = 404,
|
||||||
/// Method is not valid for the resource
|
/// Method is not valid for the resource
|
||||||
MethodNotAllowed = 405,
|
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
|
/// 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
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -75,6 +75,8 @@ QByteArray QHttpSocketPrivate::statusReason(int statusCode) const
|
|||||||
{
|
{
|
||||||
switch (statusCode) {
|
switch (statusCode) {
|
||||||
case QHttpSocket::OK: return "OK";
|
case QHttpSocket::OK: return "OK";
|
||||||
|
case QHttpSocket::Created: return "CREATED";
|
||||||
|
case QHttpSocket::Accepted: return "ACCEPTED";
|
||||||
case QHttpSocket::PartialContent: return "PARTIAL CONTENT";
|
case QHttpSocket::PartialContent: return "PARTIAL CONTENT";
|
||||||
case QHttpSocket::MovedPermanently: return "MOVED PERMANENTLY";
|
case QHttpSocket::MovedPermanently: return "MOVED PERMANENTLY";
|
||||||
case QHttpSocket::Found: return "FOUND";
|
case QHttpSocket::Found: return "FOUND";
|
||||||
@@ -83,7 +85,11 @@ QByteArray QHttpSocketPrivate::statusReason(int statusCode) const
|
|||||||
case QHttpSocket::Forbidden: return "FORBIDDEN";
|
case QHttpSocket::Forbidden: return "FORBIDDEN";
|
||||||
case QHttpSocket::NotFound: return "NOT FOUND";
|
case QHttpSocket::NotFound: return "NOT FOUND";
|
||||||
case QHttpSocket::MethodNotAllowed: return "METHOD NOT ALLOWED";
|
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::InternalServerError: return "INTERNAL SERVER ERROR";
|
||||||
|
case QHttpSocket::HttpVersionNotSupported: return "HTTP VERSION NOT SUPPORTED";
|
||||||
default: return "UNKNOWN ERROR";
|
default: return "UNKNOWN ERROR";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user