You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by GitBox <gi...@apache.org> on 2019/09/04 10:12:16 UTC

[GitHub] [httpcomponents-core] behrangsa opened a new pull request #145: Added family property

behrangsa opened a new pull request #145: Added family property
URL: https://github.com/apache/httpcomponents-core/pull/145
 
 
   ***NOTE***: The added code is taken almost verbatim from https://github.com/jax-rs/api/blob/master/jaxrs-api/src/main/java/javax/ws/rs/core/Response.java.
   
   ---
   
   It is common in apps that use HTTP clients to check if a response status code is 2xx, 3xx, 4xx, 5xx, etc. and conditionally execute code based on that.
   
   Spring's [HttpStatus](https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/http/HttpStatus.html) for example, provides these methods:
   
   ```
   public boolean is1xxInformational()
   public boolean is2xxSuccessful()
   public boolean is3xxRedirection()
   public boolean is4xxClientError()
   public boolean is5xxServerError()
   ```
   
   as well as
   
   ```
   public HttpStatus.Series series()
   ```
   
   which returns an instance of [HttpStatus.Series](https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/http/HttpStatus.Series.html).
   
   If I am not mistaken, HTTP Components does not have a similar feature, hence the code in this PR *(which is is taken almost verbatim from https://github.com/jax-rs/api/blob/master/jaxrs-api/src/main/java/javax/ws/rs/core/Response.java)*.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org