Skip to content

Commit 29df363

Browse files
committed
quickRequest now uses asStringOrFail
1 parent e4d8d95 commit 29df363

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

core/src/main/scala/sttp/client4/SttpApi.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,10 @@ trait SttpApi extends SttpExtensions with UriInterpolator {
5353
val basicRequest: PartialRequest[Either[String, String]] =
5454
emptyRequest.acceptEncoding("gzip, deflate")
5555

56-
/** A starting request which always reads the response body as a string, regardless of the status code. */
57-
val quickRequest: PartialRequest[String] = basicRequest.response(asStringAlways)
56+
/** A starting request which always reads the response body as a string, if the response code is successfull (2xx),
57+
* and fails (throws an exception, or returns a failed effect) otherwise.
58+
*/
59+
val quickRequest: PartialRequest[String] = basicRequest.response(asStringOrFail)
5860

5961
// response descriptions
6062

0 commit comments

Comments
 (0)