diff options
author | adamw <adam@warski.org> | 2017-08-30 13:38:27 +0200 |
---|---|---|
committer | adamw <adam@warski.org> | 2017-08-30 13:38:27 +0200 |
commit | dc417df3abb3d775bd1cd71b23f591b9aef33533 (patch) | |
tree | 01b9ec065335e4fb70b69c10d9a04aad92da3633 /core | |
parent | 227e1d6f4433a15dfc3529bac8387540945009cf (diff) | |
download | sttp-dc417df3abb3d775bd1cd71b23f591b9aef33533.tar.gz sttp-dc417df3abb3d775bd1cd71b23f591b9aef33533.tar.bz2 sttp-dc417df3abb3d775bd1cd71b23f591b9aef33533.zip |
Rename field in request specifiction for consistency with setting response handling method
Diffstat (limited to 'core')
-rw-r--r-- | core/src/main/scala/com/softwaremill/sttp/HttpURLConnectionSttpHandler.scala | 4 | ||||
-rw-r--r-- | core/src/main/scala/com/softwaremill/sttp/RequestT.scala | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/core/src/main/scala/com/softwaremill/sttp/HttpURLConnectionSttpHandler.scala b/core/src/main/scala/com/softwaremill/sttp/HttpURLConnectionSttpHandler.scala index ed95b07..c3023d8 100644 --- a/core/src/main/scala/com/softwaremill/sttp/HttpURLConnectionSttpHandler.scala +++ b/core/src/main/scala/com/softwaremill/sttp/HttpURLConnectionSttpHandler.scala @@ -33,12 +33,12 @@ object HttpURLConnectionSttpHandler extends SttpHandler[Id, Nothing] { try { val is = c.getInputStream - readResponse(c, is, r.responseAs) + readResponse(c, is, r.response) } catch { case e: CharacterCodingException => throw e case e: UnsupportedEncodingException => throw e case _: IOException if c.getResponseCode != -1 => - readResponse(c, c.getErrorStream, r.responseAs) + readResponse(c, c.getErrorStream, r.response) } } diff --git a/core/src/main/scala/com/softwaremill/sttp/RequestT.scala b/core/src/main/scala/com/softwaremill/sttp/RequestT.scala index 88f64e3..8d46901 100644 --- a/core/src/main/scala/com/softwaremill/sttp/RequestT.scala +++ b/core/src/main/scala/com/softwaremill/sttp/RequestT.scala @@ -25,7 +25,7 @@ case class RequestT[U[_], T, +S]( uri: U[Uri], body: RequestBody[S], headers: Seq[(String, String)], - responseAs: ResponseAs[T, S] + response: ResponseAs[T, S] ) { def get(uri: Uri): Request[T, S] = this.copy[Id, T, S](uri = uri, method = Method.GET) @@ -214,10 +214,10 @@ case class RequestT[U[_], T, +S]( * consumed by the client if such a response type is requested. */ def response[T2, S2 >: S](ra: ResponseAs[T2, S2]): RequestT[U, T2, S2] = - this.copy(responseAs = ra) + this.copy(response = ra) def mapResponse[T2](f: T => T2): RequestT[U, T2, S] = - this.copy(responseAs = responseAs.map(f)) + this.copy(response = response.map(f)) def send[R[_]]()(implicit handler: SttpHandler[R, S], isIdInRequest: IsIdInRequest[U]): R[Response[T]] = { |