kiwiproject / kiwi

A set of Java utilities that we could not find in Guava or Apache Commons...or we just felt like having our own version.
MIT License
12 stars 1 forks source link

Add a KiwiHttpResponses class with utilities to check status codes #1137

Closed sleberknight closed 6 months ago

sleberknight commented 6 months ago

This class will be very similar to the existing KiwiResponses in the org.kiwiproject.jaxrs package which is specific to and depends on Jakarta RESTful Web Services. Unlike that class, this one will have no external library dependencies, so it can be used independent of the web/REST library in use.

It will initially contain methods to check status codes and whether a status code is in a family such as a successful response, a client error response, etc.

The impetus for this was that I was recently using OkHttp's MockWebServer for some test code in a library. That library does not use Jakarta RESTful Web Services, and therefore I could not use KiwiResponses (without adding a dependency which I wanted to avoid.)