Skip to content

Instantly share code, notes, and snippets.

@RoRoche
Last active November 19, 2019 18:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RoRoche/f976f5c7a636ac8d8e8a6c986e008381 to your computer and use it in GitHub Desktop.
Save RoRoche/f976f5c7a636ac8d8e8a6c986e008381 to your computer and use it in GitHub Desktop.
import okhttp3.Response
class WithBodyRestRequest(origin: RestRequest) : RestRequest.Wrap(origin) {
override fun response(): Response {
val response = super.response()
if (response.body != null) {
return response
} else {
throw NoBodyRestResponseException()
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment