From 29df36321bd856d5203b5562dcd0b9d42ac69b04 Mon Sep 17 00:00:00 2001 From: adamw Date: Wed, 11 Dec 2024 17:53:51 +0100 Subject: [PATCH] quickRequest now uses asStringOrFail --- core/src/main/scala/sttp/client4/SttpApi.scala | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/src/main/scala/sttp/client4/SttpApi.scala b/core/src/main/scala/sttp/client4/SttpApi.scala index 7fda9af0c..368242e0a 100644 --- a/core/src/main/scala/sttp/client4/SttpApi.scala +++ b/core/src/main/scala/sttp/client4/SttpApi.scala @@ -53,8 +53,10 @@ trait SttpApi extends SttpExtensions with UriInterpolator { val basicRequest: PartialRequest[Either[String, String]] = emptyRequest.acceptEncoding("gzip, deflate") - /** A starting request which always reads the response body as a string, regardless of the status code. */ - val quickRequest: PartialRequest[String] = basicRequest.response(asStringAlways) + /** A starting request which always reads the response body as a string, if the response code is successfull (2xx), + * and fails (throws an exception, or returns a failed effect) otherwise. + */ + val quickRequest: PartialRequest[String] = basicRequest.response(asStringOrFail) // response descriptions