Open gissuebot opened 9 years ago
Original comment posted by kak@google.com on 2012-03-09 at 08:02 PM
We have something like this internally, but it'll need quite a bit of API-lovin' before we can even consider releasing it.
Status: Acknowledged
Owner: kurt.kluever
Labels: Package-Net
, Type-Enhancement
Original comment posted by kevinb@google.com on 2012-05-30 at 07:45 PM
(No comment entered for this change.)
Labels: -Type-Enhancement
, Type-Addition
Original comment posted by trejkaz on 2012-06-13 at 02:14 AM
I was just thinking that this would be nice and it looks like I'm not the only one. :)
Original comment posted by kevinb@google.com on 2012-06-22 at 06:16 PM
(No comment entered for this change.)
Status: Research
Original comment posted by alexande...@teamdev.com on 2013-08-25 at 09:09 AM
Yes, something like http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/http/HttpStatus.html would be nice.
I just bumped into this as well -- patches accepted?
The only issue is that we're not sure what the best design is: a file with a bunch of static int's? an enum? a full fledged class with static instances?
...or something completely different.
Supporting extensibility appears important:
HTTP status codes are extensible. HTTP applications are not required to understand the meaning of all registered status codes, though such understanding is obviously desirable.
Supporting extensibility could happen in creation and/or consumption. Twitter uses a few nonstandard 4xx codes to signal throttling and rate limiting errors. For example, the class should be able to do something useful when asked to interpret the nonstandard 429 from 'HTTP 429 Too Many Requests'.
+1 for something like the Spring Enum mentioned above
I think that a full fledged class with static instances would work best, since it also has support for nonstandard status codes such as 429 Too Many Requests. Also, this way, it would also be able to store the status code and the associated message.
Original issue created by electrum on 2012-03-09 at 07:58 PM
The new HttpHeaders and MediaType classes are great! Can we get a similar HttpStatusCodes class? The JAX-RS Response.Status class could be a good starting point.