Skip to content

Added all HTTP status codes #336

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 1, 2013
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Added all HTTP status codes
Added all the missing HTTP v1.1 status codes and corrected the naming to
the standard of some of the existing ones.
  • Loading branch information
patlecat committed Dec 1, 2013
commit 403f65921e9d3425ddc62d027902c1631c4bff86
37 changes: 32 additions & 5 deletions boost/network/protocol/http/impl/response.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -29,32 +29,59 @@ namespace boost { namespace network { namespace http {
typedef tags::http_server tag;
typedef response_header<tags::http_server>::type header_type;

/// The status of the reply.
/*! The status of the reply. Represent all the status codes of HTTP v1.1
* from http://tools.ietf.org/html/rfc2616#page-39 and
* http://tools.ietf.org/html/rfc6585
*/
enum status_type {
continue_http = 100,
switching_protocols = 101,
ok = 200,
created = 201,
accepted = 202,
non_authoritative_information = 203,
no_content = 204,
reset_content = 205,
partial_content = 206,
multiple_choices = 300,
moved_permanently = 301,
moved_temporarily = 302,
found = 302,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wary of making potentially breaking changes like these. Can you avoid renaming "moved_temporarily" here?

see_other = 303,
not_modified = 304,
use_proxy = 305,
temporary_redirect = 307,
bad_request = 400,
unauthorized = 401,
forbidden = 403,
payment_required = 402,
forbidden = 403,
not_found = 404,
not_supported = 405,
method_not_allowed = 405,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

not_acceptable = 406,
proxy_authentication_required = 407,
request_timeout = 408,
conflict = 409,
gone = 410,
length_required = 411,
precondition_failed = 412,
unsatisfiable_range = 416,
request_entity_too_large = 413,
request_uri_too_large = 414,
unsupported_media_type = 415,
requested_range_not_satisfiable = 416,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

expectation_failed = 417,
precondition_required = 428,
too_many_requests = 429,
request_header_fields_too_large = 431,
internal_server_error = 500,
not_implemented = 501,
bad_gateway = 502,
service_unavailable = 503,
space_unavailable = 507
gateway_timeout = 504,
http_version_not_supported = 505,
space_unavailable = 507,
network_authentication_required = 511
} status;


/// The headers to be included in the reply.
typedef vector<tags::http_server>::apply<header_type>::type headers_vector;
Expand Down