![JAR search and dependency download from the Maven repository](/logo.png)
com.gu.contentapi.client.model.HttpResponse.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of content-api-client_2.12 Show documentation
Show all versions of content-api-client_2.12 Show documentation
Scala client for the Guardian's Content API
The newest version!
package com.gu.contentapi.client.model
case class HttpResponse(body: Array[Byte], statusCode: Int, statusMessage: String)
object HttpResponse {
val failedButMaybeRecoverableCodes = Set(408, 429, 504, 509)
val successfulResponseCodes = Set(200, 302)
def isSuccessHttpResponse(httpResponse: HttpResponse) = successfulResponseCodes.contains(httpResponse.statusCode)
def isRecoverableHttpResponse(httpResponse: HttpResponse) = failedButMaybeRecoverableCodes.contains(httpResponse.statusCode)
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy