Skip to content
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

Add functionality for checking status codes of a response #111

Closed
IIVat opened this issue Jun 24, 2018 · 1 comment
Closed

Add functionality for checking status codes of a response #111

IIVat opened this issue Jun 24, 2018 · 1 comment

Comments

@IIVat
Copy link
Contributor

IIVat commented Jun 24, 2018

It would be very helpful to check a status codes of a response with methods :

@Lenses case class Status(code: Int, text: String, description: String) {
  def isInformational: Boolean = this.code / 100 == 1
  def isSuccess: Boolean = this.code / 100 == 2
  def isRedirection: Boolean = this.code / 100 == 3
  def isClientError: Boolean = this.code / 100 == 4
  def isServerError: Boolean = this.code / 100 == 5
}
IIVat added a commit to IIVat/hammock that referenced this issue Jun 24, 2018
IIVat added a commit to IIVat/hammock that referenced this issue Jun 30, 2018
pepegar pushed a commit that referenced this issue Jul 2, 2018
* #111 added methods to Status

* #111 added tests
@pepegar
Copy link
Owner

pepegar commented Jul 3, 2018

fixed in #112

@pepegar pepegar closed this as completed Jul 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants