From 3f47b1c97c8c4135ef7c62a36a3a6021af79fbb2 Mon Sep 17 00:00:00 2001 From: adamw Date: Wed, 16 Sep 2020 18:15:32 +0200 Subject: [PATCH] Change package name and artifact organization to sttp.client3 --- README.md | 18 ++++---- .../akkahttp/AkkaHttpBackend.scala | 14 +++---- .../akkahttp/AkkaHttpClient.scala | 2 +- .../akkahttp/BodyFromAkka.scala | 8 ++-- .../akkahttp/BodyToAkka.scala | 6 +-- .../akkahttp/FromAkka.scala | 4 +- .../{client => client3}/akkahttp/ToAkka.scala | 4 +- .../{client => client3}/akkahttp/Util.scala | 4 +- .../akkahttp/AkkaHttpClientHttpTest.scala | 6 +-- .../akkahttp/AkkaHttpRouteBackendTest.scala | 6 +-- .../akkahttp/AkkaHttpStreamingTest.scala | 8 ++-- .../akkahttp/AkkaHttpWebSocketTest.scala | 8 ++-- .../akkahttp/SttpBackendStubAkkaTests.scala | 4 +- .../cats/AsyncHttpClientCatsBackend.scala | 14 +++---- .../cats/AsyncHttpClientCatsHttpTest.scala | 8 ++-- .../fs2/AsyncHttpClientFs2Backend.scala | 16 +++---- .../AsyncHttpClientFs2HttpStreamingTest.scala | 6 +-- .../fs2/AsyncHttpClientFs2HttpTest.scala | 8 ++-- .../fs2/AsyncHttpClientFs2WebSocketTest.scala | 10 ++--- .../future/AsyncHttpClientFutureBackend.scala | 12 +++--- .../AsyncHttpClientFutureHttpTest.scala | 6 +-- .../monix/AsyncHttpClientMonixBackend.scala | 14 +++---- .../monix/AsyncHttpClientMonixHttpTest.scala | 12 +++--- .../AsyncHttpClientMonixStreamingTest.scala | 6 +-- .../AsyncHttpClientMonixWebSocketTest.scala | 10 ++--- .../scalaz/AsyncHttpClientScalazBackend.scala | 14 +++---- .../AsyncHttpClientScalazHttpTest.scala | 8 ++-- .../AsyncHttpClientBackend.scala | 12 +++--- .../asynchttpclient/BodyFromAHC.scala | 8 ++-- .../asynchttpclient/BodyToAHC.scala | 6 +-- .../asynchttpclient/WebSocketImpl.scala | 4 +- .../asynchttpclient/reactive.scala | 2 +- .../AsyncHttpClientWebSocketTest.scala | 4 +- .../zio/AsyncHttpClientZioBackend.scala | 14 +++---- .../asynchttpclient/zio/package.scala | 6 +-- .../zio/AsyncHttpClientZioHttpTest.scala | 8 ++-- .../zio/AsyncHttpClientZioStreamingTest.scala | 12 +++--- .../zio/AsyncHttpClientZioWebSocketTest.scala | 10 ++--- .../zio/SttpBackendStubZioTests.scala | 8 ++-- build.sbt | 4 +- .../DigestAuthenticationBackend.scala | 12 +++--- .../{client => client3}/EitherBackend.scala | 4 +- .../FollowRedirectsBackend.scala | 6 +-- .../{client => client3}/RequestBody.scala | 6 +-- .../{client => client3}/RequestMetadata.scala | 4 +- .../sttp/{client => client3}/RequestT.scala | 14 +++---- .../sttp/{client => client3}/Response.scala | 10 ++--- .../sttp/{client => client3}/ResponseAs.scala | 8 ++-- .../ResponseMetadata.scala | 2 +- .../sttp/{client => client3}/RetryWhen.scala | 2 +- .../sttp/{client => client3}/SttpApi.scala | 10 ++--- .../{client => client3}/SttpBackend.scala | 2 +- .../SttpBackendOptions.scala | 4 +- .../SttpClientException.scala | 4 +- .../sttp/{client => client3}/TryBackend.scala | 4 +- .../internal/BodyFromResponseAs.scala | 6 +-- .../internal/DigestAuthenticator.scala | 10 ++--- .../internal/NoStreams.scala | 2 +- .../internal/SttpFile.scala | 2 +- .../internal/ToCurlConverter.scala | 6 +-- .../internal/WwwAuthHeaderParser.scala | 2 +- .../internal/package.scala | 36 ++++++++-------- .../internal/ws/FutureSimpleQueue.scala | 2 +- .../internal/ws/SimpleQueue.scala | 2 +- .../internal/ws/SyncQueue.scala | 4 +- .../internal/ws/WebSocketEvent.scala | 2 +- .../listener/ListenerBackend.scala | 4 +- .../listener/RequestListener.scala | 4 +- .../{client => client3}/logging/Log.scala | 4 +- .../{client => client3}/logging/Logger.scala | 2 +- .../logging/LoggingBackend.scala | 6 +-- .../{client => client3}/monad/FunctionK.scala | 2 +- .../{client => client3}/monad/IdMonad.scala | 4 +- .../{client => client3}/monad/MapEffect.scala | 4 +- .../sttp/{client => client3}/package.scala | 2 +- .../testing/RecordingSttpBackend.scala | 4 +- .../testing/SttpBackendStub.scala | 14 +++---- .../{client => client3}/testing/package.scala | 4 +- .../{client => client3}/ws/exceptions.scala | 2 +- .../AbstractFetchBackend.scala | 8 ++-- .../{client => client3}/FetchBackend.scala | 6 +-- .../RequestTExtensions.scala | 6 +-- .../{client => client3}/SttpExtensions.scala | 6 +-- .../ToCurlConverterTestExtension.scala | 2 +- .../dom/experimental/AbortController.scala | 2 +- .../dom/experimental/File.scala | 2 +- .../internal/MessageDigestCompatibility.scala | 4 +- .../internal/SparkMD5.scala | 4 +- .../internal/SttpFileExtensions.scala | 6 +-- .../sttp/{client => client3}/quick.scala | 2 +- .../HttpURLConnectionBackend.scala | 14 +++---- .../RequestTExtensions.scala | 4 +- .../{client => client3}/SttpExtensions.scala | 4 +- .../TryHttpURLConnectionBackend.scala | 4 +- .../internal/FileHelpers.scala | 4 +- .../internal/MessageDigestCompatibility.scala | 4 +- .../internal/SttpFileExtensions.scala | 2 +- .../sttp/{client => client3}/quick.scala | 2 +- .../sttp/client/curl/CurlList.scala | 5 --- .../AbstractCurlBackend.scala | 16 +++---- .../{client => client3}/CurlBackends.scala | 4 +- .../{client => client3}/FileHelpers.scala | 6 +-- .../RequestTExtensions.scala | 4 +- .../{client => client3}/SttpExtensions.scala | 4 +- .../sttp/{client => client3}/curl/CCurl.scala | 4 +- .../{client => client3}/curl/CurlApi.scala | 10 ++--- .../{client => client3}/curl/CurlCode.scala | 4 +- .../{client => client3}/curl/CurlInfo.scala | 4 +- .../sttp/client3/curl/CurlList.scala | 5 +++ .../{client => client3}/curl/CurlOption.scala | 4 +- .../{client => client3}/curl/CurlSpaces.scala | 2 +- .../{client => client3}/curl/package.scala | 2 +- .../internal/CryptoMd5.scala | 2 +- .../internal/MessageDigestCompatibility.scala | 4 +- .../internal/SttpFileExtensions.scala | 2 +- .../sttp/{client => client3}/quick.scala | 2 +- .../FollowRedirectsBackendTest.scala | 2 +- .../{client => client3}/RequestTests.scala | 2 +- .../RetryWhenDefaultTest.scala | 8 ++-- .../SttpBackendOptionsProxyTest.scala | 2 +- .../ToCurlConverterTest.scala | 2 +- .../internal/DigestAuthenticatorTest.scala | 6 +-- .../internal/WwwAuthHeaderParserTest.scala | 2 +- .../testing/CancelTest.scala | 6 +-- .../testing/ConvertToFuture.scala | 4 +- .../testing/HttpTest.scala | 8 ++-- .../testing/SttpBackendStubTests.scala | 8 ++-- .../testing/ToFutureWrapper.scala | 2 +- .../testing/streaming/StreamingTest.scala | 10 ++--- .../streaming/StreamingTestExtensions.scala | 7 ---- .../{client => client3}/FetchHttpTest.scala | 4 +- .../testing/AbstractFetchHttpTest.scala | 4 +- .../testing/AsyncExecutionContext.scala | 2 +- .../testing/HttpTestExtensions.scala | 8 ++-- .../testing/Platform.scala | 2 +- .../streaming/StreamingTestExtensions.scala | 7 ++++ .../CookieRequestTests.scala | 2 +- .../HttpURLConnectionBackendHttpTest.scala | 4 +- .../ToCurlConverterTestExtension.scala | 4 +- .../TryHttpURLConnectionHttpTest.scala | 6 +-- .../testing/HttpTestExtensions.scala | 4 +- .../testing/Platform.scala | 2 +- .../streaming/StreamingTestExtensions.scala | 2 +- .../WebSocketBufferOverflowTest.scala | 8 ++-- .../websocket/WebSocketStreamingTest.scala | 10 ++--- .../testing/websocket/WebSocketTest.scala | 14 +++---- .../streaming/StreamingTestExtensions.scala | 6 --- .../CurlBackendHttpTest.scala | 4 +- .../ToCurlConverterTestExtension.scala | 2 +- .../testing/AsyncExecutionContext.scala | 2 +- .../testing/HttpTestExtensions.scala | 2 +- .../testing/Platform.scala | 2 +- .../testing/SyncHttpTest.scala | 8 ++-- .../testing/SyncHttpTestExtensions.scala | 4 +- .../streaming/StreamingTestExtensions.scala | 6 +++ docs/backends/akka.md | 16 +++---- docs/backends/catseffect.md | 6 +-- docs/backends/finagle.md | 4 +- docs/backends/fs2.md | 22 +++++----- docs/backends/future.md | 14 +++---- docs/backends/http4s.md | 4 +- docs/backends/javascript/fetch.md | 8 ++-- docs/backends/monix.md | 24 +++++------ docs/backends/native/curl.md | 2 +- docs/backends/scalaz.md | 6 +-- docs/backends/synchronous.md | 16 +++---- docs/backends/wrappers/custom.md | 22 +++++----- docs/backends/wrappers/logging.md | 16 +++---- docs/backends/wrappers/opentracing.md | 10 ++--- docs/backends/wrappers/prometheus.md | 14 +++---- docs/backends/wrappers/zio-opentracing.md | 6 +-- docs/backends/zio.md | 36 ++++++++-------- docs/conf/proxy.md | 4 +- docs/conf/redirects.md | 4 +- docs/conf/timeouts.md | 2 +- docs/examples.md | 42 +++++++++---------- docs/how.md | 8 ++-- docs/index.md | 2 +- docs/json.md | 26 ++++++------ docs/model/model.md | 4 +- docs/model/uri.md | 6 +-- docs/openapi.md | 8 ++-- docs/quickstart.md | 18 ++++---- docs/requests/authentication.md | 4 +- docs/requests/basics.md | 2 +- docs/requests/body.md | 12 +++--- docs/requests/cookies.md | 6 +-- docs/requests/headers.md | 6 +-- docs/requests/multipart.md | 8 ++-- docs/requests/streaming.md | 2 +- docs/responses/basics.md | 2 +- docs/responses/body.md | 28 ++++++------- docs/responses/exceptions.md | 2 +- docs/testing.md | 8 ++-- docs/websockets.md | 10 ++--- .../GetAndParseJsonAkkaHttpJson4s.scala | 8 ++-- .../GetAndParseJsonGetRightMonixCirce.scala | 8 ++-- .../examples/GetAndParseJsonZioCirce.scala | 8 ++-- .../GetRawResponseBodySynchronous.scala | 6 +-- .../examples/LogRequestsSlf4j.scala | 8 ++-- .../examples/PostFormSynchronous.scala | 4 +- ...rializeJsonMonixAsyncHttpClientCirce.scala | 8 ++-- .../examples/RetryZio.scala | 6 +-- .../examples/StreamFs2.scala | 6 +-- .../examples/StreamZio.scala | 6 +-- .../TestEndpointMultipleQueryParameters.scala | 6 +-- .../examples/WebSocketAkka.scala | 6 +-- .../examples/WebSocketMonix.scala | 6 +-- .../examples/WebSocketStreamFs2.scala | 6 +-- .../examples/WebSocketTesting.scala | 8 ++-- .../examples/WebSocketZio.scala | 6 +-- .../finagle/FinagleBackend.scala | 12 +++--- .../finagle/FinagleBackendTest.scala | 6 +-- generated-docs/out/backends/akka.md | 16 +++---- generated-docs/out/backends/catseffect.md | 6 +-- generated-docs/out/backends/finagle.md | 4 +- generated-docs/out/backends/fs2.md | 22 +++++----- generated-docs/out/backends/future.md | 14 +++---- generated-docs/out/backends/http4s.md | 4 +- .../out/backends/javascript/fetch.md | 8 ++-- generated-docs/out/backends/monix.md | 24 +++++------ generated-docs/out/backends/native/curl.md | 2 +- generated-docs/out/backends/scalaz.md | 6 +-- generated-docs/out/backends/synchronous.md | 16 +++---- .../out/backends/wrappers/custom.md | 22 +++++----- .../out/backends/wrappers/logging.md | 14 +++---- .../out/backends/wrappers/opentracing.md | 10 ++--- .../out/backends/wrappers/prometheus.md | 14 +++---- generated-docs/out/backends/wrappers/slf4j.md | 10 ++--- .../out/backends/wrappers/zio-opentracing.md | 6 +-- generated-docs/out/backends/zio.md | 36 ++++++++-------- generated-docs/out/conf/proxy.md | 4 +- generated-docs/out/conf/redirects.md | 4 +- generated-docs/out/conf/timeouts.md | 2 +- generated-docs/out/examples.md | 42 +++++++++---------- generated-docs/out/how.md | 8 ++-- generated-docs/out/index.md | 2 +- generated-docs/out/json.md | 26 ++++++------ generated-docs/out/model/model.md | 4 +- generated-docs/out/model/uri.md | 6 +-- generated-docs/out/openapi.md | 8 ++-- generated-docs/out/quickstart.md | 18 ++++---- generated-docs/out/requests/authentication.md | 4 +- generated-docs/out/requests/basics.md | 2 +- generated-docs/out/requests/body.md | 12 +++--- generated-docs/out/requests/cookies.md | 6 +-- generated-docs/out/requests/headers.md | 6 +-- generated-docs/out/requests/multipart.md | 8 ++-- generated-docs/out/requests/streaming.md | 2 +- generated-docs/out/responses/basics.md | 2 +- generated-docs/out/responses/body.md | 28 ++++++------- generated-docs/out/responses/exceptions.md | 2 +- generated-docs/out/testing.md | 8 ++-- generated-docs/out/websockets.md | 10 ++--- .../http4s/Http4sBackend.scala | 14 +++---- .../http4s/Http4sHttpStreamingTest.scala | 6 +-- .../http4s/Http4sHttpTest.scala | 8 ++-- .../fs2/Fs2BodyFromHttpClient.scala | 14 +++---- .../httpclient/fs2/HttpClientFs2Backend.scala | 18 ++++---- .../fs2/HttpClientFs2HttpTest.scala | 4 +- .../fs2/HttpClientFs2StreamingTest.scala | 4 +- .../fs2/HttpClientFs2TestBase.scala | 6 +-- .../fs2/HttpClientFs2WebSocketTest.scala | 14 ++++--- .../monix/HttpClientMonixBackend.scala | 18 ++++---- .../monix/HttpClientMonixHttpTest.scala | 8 ++-- .../monix/HttpClientMonixStreamingTest.scala | 6 +-- .../monix/HttpClientMonixWebSocketTest.scala | 10 ++--- .../httpclient/BodyFromHttpClient.scala | 6 +-- .../httpclient/BodyToHttpClient.scala | 6 +-- .../DelegatingWebSocketListener.scala | 2 +- .../httpclient/HttpClientAsyncBackend.scala | 8 ++-- .../httpclient/HttpClientBackend.scala | 8 ++-- .../httpclient/HttpClientFutureBackend.scala | 14 +++---- .../httpclient/HttpClientSyncBackend.scala | 14 +++---- .../InputStreamBodyFromHttpClient.scala | 8 ++-- .../httpclient/InputStreamSubscriber.scala | 4 +- .../httpclient/MultiPartBodyPublisher.java | 2 +- .../httpclient/WebSocketImpl.scala | 4 +- .../httpclient/HttpClientFutureHttpTest.scala | 6 +-- .../HttpClientFutureWebSocketTest.scala | 8 ++-- .../httpclient/HttpClientSyncHttpTest.scala | 6 +-- .../httpclient/zio/HttpClientZioBackend.scala | 16 +++---- .../zio/ZioBodyFromHttpClient.scala | 12 +++--- .../httpclient/zio/package.scala | 6 +-- .../zio/HttpClientZioHttpTest.scala | 8 ++-- .../zio/HttpClientZioStreamingTest.scala | 12 +++--- .../zio/HttpClientZioWebSocketTest.scala | 12 +++--- .../zio/SttpBackendStubZioTests.scala | 8 ++-- .../impl/cats/CatsMonadAsyncError.scala | 2 +- .../impl/cats/implicits.scala | 6 +-- .../impl/cats/CatsTestBase.scala | 4 +- .../impl/cats/package.scala | 4 +- .../impl/fs2/Fs2SimpleQueue.scala | 4 +- .../impl/fs2/Fs2WebSockets.scala | 2 +- .../impl/fs2/Fs2StreamingTest.scala | 6 +-- .../impl/monix/MonixSimpleQueue.scala | 4 +- .../impl/monix/MonixWebSockets.scala | 2 +- .../impl/monix/TaskMonadAsyncError.scala | 2 +- .../impl/monix/FetchMonixBackend.scala | 6 +-- .../impl/monix/MonixStreamingTest.scala | 6 +-- .../impl/monix/package.scala | 4 +- .../impl/monix/FetchMonixHttpTest.scala | 6 +-- .../impl/monix/FetchMonixStreamingTest.scala | 4 +- .../impl/scalaz/TaskMonadAsyncError.scala | 2 +- .../impl/scalaz/implicits.scala | 6 +-- .../impl/scalaz/package.scala | 4 +- .../impl/zio/RIOMonadAsyncError.scala | 2 +- .../impl/zio/SttpClientStubbingBase.scala | 6 +-- .../impl/zio/ZioSimpleQueue.scala | 4 +- .../impl/zio/ZioWebSockets.scala | 6 +-- .../impl/zio/package.scala | 6 +-- .../impl/zio/ZioTestBase.scala | 4 +- .../circe/SttpCirceApi.scala | 8 ++-- .../{client => client3}/circe/package.scala | 2 +- .../circe/CirceTests.scala | 6 +-- .../circe/SttpBackendStubCirceTests.scala | 6 +-- .../sttp/{client => client3}/IsOption.scala | 2 +- .../sttp/{client => client3}/JsonInput.scala | 2 +- .../{client => client3}/json/package.scala | 2 +- .../json4s/SttpJson4sApi.scala | 8 ++-- .../{client => client3}/json4s/package.scala | 2 +- .../{client => client3}/Json4sTests.scala | 4 +- .../playJson/SttpPlayJsonApi.scala | 8 ++-- .../playJson/package.scala | 2 +- .../{client => client3}/PlayJsonTests.scala | 12 +++--- .../sprayJson/SttpSprayJsonApi.scala | 8 ++-- .../sprayJson/package.scala | 2 +- .../{client => client3}/SprayJsonTests.scala | 8 ++-- .../logging/scribe/ScribeLogger.scala | 4 +- .../logging/scribe/ScribeLoggingBackend.scala | 6 +-- .../logging/slf4j/Slf4jLogger.scala | 4 +- .../logging/slf4j/Slf4jLoggingBackend.scala | 8 ++-- manual-tests/proxy-digest-test.md | 2 +- .../opentracing/OpenTracingBackend.scala | 6 +-- .../opentracing/RequestBuilderCarrier.scala | 4 +- .../opentracing/OpenTracingBackendTest.scala | 10 ++--- .../prometheus/PrometheusBackend.scala | 8 ++-- .../prometheus/PrometheusBackendTest.scala | 6 +-- .../ZioTelemetryOpenTracingBackend.scala | 6 +-- .../okhttp/monix/OkHttpMonixBackend.scala | 14 +++---- .../okhttp/monix/OkHttpMonixHttpTest.scala | 8 ++-- .../monix/OkHttpMonixStreamingTest.scala | 6 +-- .../monix/OkHttpMonixWebSocketTest.scala | 12 +++--- .../okhttp/BodyFromOkHttp.scala | 8 ++-- .../okhttp/BodyToOkHttp.scala | 4 +- .../okhttp/OkHttpAsyncBackend.scala | 8 ++-- .../okhttp/OkHttpBackend.scala | 12 +++--- .../okhttp/OkHttpFutureBackend.scala | 12 +++--- .../okhttp/OkHttpSyncBackend.scala | 14 +++---- .../okhttp/WebSocketImpl.scala | 4 +- .../{client => client3}/okhttp/quick.scala | 4 +- .../okhttp/OkHttpFutureHttpTest.scala | 6 +-- .../okhttp/OkHttpFutureWebsocketTest.scala | 8 ++-- .../OkHttpSyncDigestAuthProxyManualTest.scala | 6 +-- .../okhttp/OkHttpSyncHttpTest.scala | 6 +-- .../okhttp/OkHttpSyncWebSocketTest.scala | 12 +++--- .../testing/compile/EvalScala.scala | 2 +- .../testing/compile/IllTypedTests.scala | 8 ++-- .../testing/server/HttpServer.scala | 33 +++++++-------- 359 files changed, 1331 insertions(+), 1330 deletions(-) rename akka-http-backend/src/main/scala/sttp/{client => client3}/akkahttp/AkkaHttpBackend.scala (96%) rename akka-http-backend/src/main/scala/sttp/{client => client3}/akkahttp/AkkaHttpClient.scala (99%) rename akka-http-backend/src/main/scala/sttp/{client => client3}/akkahttp/BodyFromAkka.scala (97%) rename akka-http-backend/src/main/scala/sttp/{client => client3}/akkahttp/BodyToAkka.scala (97%) rename akka-http-backend/src/main/scala/sttp/{client => client3}/akkahttp/FromAkka.scala (93%) rename akka-http-backend/src/main/scala/sttp/{client => client3}/akkahttp/ToAkka.scala (96%) rename akka-http-backend/src/main/scala/sttp/{client => client3}/akkahttp/Util.scala (96%) rename akka-http-backend/src/test/scala/sttp/{client => client3}/akkahttp/AkkaHttpClientHttpTest.scala (68%) rename akka-http-backend/src/test/scala/sttp/{client => client3}/akkahttp/AkkaHttpRouteBackendTest.scala (94%) rename akka-http-backend/src/test/scala/sttp/{client => client3}/akkahttp/AkkaHttpStreamingTest.scala (84%) rename akka-http-backend/src/test/scala/sttp/{client => client3}/akkahttp/AkkaHttpWebSocketTest.scala (89%) rename akka-http-backend/src/test/scala/sttp/{client => client3}/akkahttp/SttpBackendStubAkkaTests.scala (95%) rename async-http-client-backend/cats/src/main/scala/sttp/{client => client3}/asynchttpclient/cats/AsyncHttpClientCatsBackend.scala (94%) rename async-http-client-backend/cats/src/test/scala/sttp/{client => client3}/asynchttpclient/cats/AsyncHttpClientCatsHttpTest.scala (84%) rename async-http-client-backend/fs2/src/main/scala/sttp/{client => client3}/asynchttpclient/fs2/AsyncHttpClientFs2Backend.scala (95%) rename async-http-client-backend/fs2/src/test/scala/sttp/{client => client3}/asynchttpclient/fs2/AsyncHttpClientFs2HttpStreamingTest.scala (82%) rename async-http-client-backend/fs2/src/test/scala/sttp/{client => client3}/asynchttpclient/fs2/AsyncHttpClientFs2HttpTest.scala (69%) rename async-http-client-backend/fs2/src/test/scala/sttp/{client => client3}/asynchttpclient/fs2/AsyncHttpClientFs2WebSocketTest.scala (87%) rename async-http-client-backend/future/src/main/scala/sttp/{client => client3}/asynchttpclient/future/AsyncHttpClientFutureBackend.scala (93%) rename async-http-client-backend/future/src/test/scala/sttp/{client => client3}/asynchttpclient/future/AsyncHttpClientFutureHttpTest.scala (71%) rename async-http-client-backend/monix/src/main/scala/sttp/{client => client3}/asynchttpclient/monix/AsyncHttpClientMonixBackend.scala (95%) rename async-http-client-backend/monix/src/test/scala/sttp/{client => client3}/asynchttpclient/monix/AsyncHttpClientMonixHttpTest.scala (71%) rename async-http-client-backend/monix/src/test/scala/sttp/{client => client3}/asynchttpclient/monix/AsyncHttpClientMonixStreamingTest.scala (74%) rename async-http-client-backend/monix/src/test/scala/sttp/{client => client3}/asynchttpclient/monix/AsyncHttpClientMonixWebSocketTest.scala (85%) rename async-http-client-backend/scalaz/src/main/scala/sttp/{client => client3}/asynchttpclient/scalaz/AsyncHttpClientScalazBackend.scala (90%) rename async-http-client-backend/scalaz/src/test/scala/sttp/{client => client3}/asynchttpclient/scalaz/AsyncHttpClientScalazHttpTest.scala (64%) rename async-http-client-backend/src/main/scala/sttp/{client => client3}/asynchttpclient/AsyncHttpClientBackend.scala (97%) rename async-http-client-backend/src/main/scala/sttp/{client => client3}/asynchttpclient/BodyFromAHC.scala (95%) rename async-http-client-backend/src/main/scala/sttp/{client => client3}/asynchttpclient/BodyToAHC.scala (95%) rename async-http-client-backend/src/main/scala/sttp/{client => client3}/asynchttpclient/WebSocketImpl.scala (97%) rename async-http-client-backend/src/main/scala/sttp/{client => client3}/asynchttpclient/reactive.scala (98%) rename async-http-client-backend/src/test/scala/sttp/{client => client3}/asynchttpclient/AsyncHttpClientWebSocketTest.scala (68%) rename async-http-client-backend/zio/src/main/scala/sttp/{client => client3}/asynchttpclient/zio/AsyncHttpClientZioBackend.scala (96%) rename async-http-client-backend/zio/src/main/scala/sttp/{client => client3}/asynchttpclient/zio/package.scala (95%) rename async-http-client-backend/zio/src/test/scala/sttp/{client => client3}/asynchttpclient/zio/AsyncHttpClientZioHttpTest.scala (76%) rename async-http-client-backend/zio/src/test/scala/sttp/{client => client3}/asynchttpclient/zio/AsyncHttpClientZioStreamingTest.scala (76%) rename async-http-client-backend/zio/src/test/scala/sttp/{client => client3}/asynchttpclient/zio/AsyncHttpClientZioWebSocketTest.scala (86%) rename async-http-client-backend/zio/src/test/scala/sttp/{client => client3}/asynchttpclient/zio/SttpBackendStubZioTests.scala (93%) rename core/src/main/scala/sttp/{client => client3}/DigestAuthenticationBackend.scala (84%) rename core/src/main/scala/sttp/{client => client3}/EitherBackend.scala (95%) rename core/src/main/scala/sttp/{client => client3}/FollowRedirectsBackend.scala (96%) rename core/src/main/scala/sttp/{client => client3}/RequestBody.scala (94%) rename core/src/main/scala/sttp/{client => client3}/RequestMetadata.scala (80%) rename core/src/main/scala/sttp/{client => client3}/RequestT.scala (97%) rename core/src/main/scala/sttp/{client => client3}/Response.scala (86%) rename core/src/main/scala/sttp/{client => client3}/ResponseAs.scala (98%) rename core/src/main/scala/sttp/{client => client3}/ResponseMetadata.scala (97%) rename core/src/main/scala/sttp/{client => client3}/RetryWhen.scala (97%) rename core/src/main/scala/sttp/{client => client3}/SttpApi.scala (97%) rename core/src/main/scala/sttp/{client => client3}/SttpBackend.scala (98%) rename core/src/main/scala/sttp/{client => client3}/SttpBackendOptions.scala (98%) rename core/src/main/scala/sttp/{client => client3}/SttpClientException.scala (97%) rename core/src/main/scala/sttp/{client => client3}/TryBackend.scala (94%) rename core/src/main/scala/sttp/{client => client3}/internal/BodyFromResponseAs.scala (96%) rename core/src/main/scala/sttp/{client => client3}/internal/DigestAuthenticator.scala (97%) rename core/src/main/scala/sttp/{client => client3}/internal/NoStreams.scala (86%) rename core/src/main/scala/sttp/{client => client3}/internal/SttpFile.scala (94%) rename core/src/main/scala/sttp/{client => client3}/internal/ToCurlConverter.scala (96%) rename core/src/main/scala/sttp/{client => client3}/internal/WwwAuthHeaderParser.scala (99%) rename core/src/main/scala/sttp/{client => client3}/internal/package.scala (60%) rename core/src/main/scala/sttp/{client => client3}/internal/ws/FutureSimpleQueue.scala (96%) rename core/src/main/scala/sttp/{client => client3}/internal/ws/SimpleQueue.scala (88%) rename core/src/main/scala/sttp/{client => client3}/internal/ws/SyncQueue.scala (92%) rename core/src/main/scala/sttp/{client => client3}/internal/ws/WebSocketEvent.scala (88%) rename core/src/main/scala/sttp/{client => client3}/listener/ListenerBackend.scala (95%) rename core/src/main/scala/sttp/{client => client3}/listener/RequestListener.scala (93%) rename core/src/main/scala/sttp/{client => client3}/logging/Log.scala (96%) rename core/src/main/scala/sttp/{client => client3}/logging/Logger.scala (93%) rename core/src/main/scala/sttp/{client => client3}/logging/LoggingBackend.scala (96%) rename core/src/main/scala/sttp/{client => client3}/monad/FunctionK.scala (70%) rename core/src/main/scala/sttp/{client => client3}/monad/IdMonad.scala (92%) rename core/src/main/scala/sttp/{client => client3}/monad/MapEffect.scala (99%) rename core/src/main/scala/sttp/{client => client3}/package.scala (95%) rename core/src/main/scala/sttp/{client => client3}/testing/RecordingSttpBackend.scala (94%) rename core/src/main/scala/sttp/{client => client3}/testing/SttpBackendStub.scala (96%) rename core/src/main/scala/sttp/{client => client3}/testing/package.scala (94%) rename core/src/main/scala/sttp/{client => client3}/ws/exceptions.scala (91%) rename core/src/main/scalajs/sttp/{client => client3}/AbstractFetchBackend.scala (97%) rename core/src/main/scalajs/sttp/{client => client3}/FetchBackend.scala (94%) rename core/src/main/scalajs/sttp/{client => client3}/RequestTExtensions.scala (87%) rename core/src/main/scalajs/sttp/{client => client3}/SttpExtensions.scala (86%) rename core/src/main/scalajs/sttp/{client => client3}/ToCurlConverterTestExtension.scala (65%) rename core/src/main/scalajs/sttp/{client => client3}/dom/experimental/AbortController.scala (91%) rename core/src/main/scalajs/sttp/{client => client3}/dom/experimental/File.scala (96%) rename core/src/main/scalajs/sttp/{client => client3}/internal/MessageDigestCompatibility.scala (80%) rename core/src/main/scalajs/sttp/{client => client3}/internal/SparkMD5.scala (75%) rename core/src/main/scalajs/sttp/{client => client3}/internal/SttpFileExtensions.scala (75%) rename core/src/main/scalajs/sttp/{client => client3}/quick.scala (85%) rename core/src/main/scalajvm/sttp/{client => client3}/HttpURLConnectionBackend.scala (96%) rename core/src/main/scalajvm/sttp/{client => client3}/RequestTExtensions.scala (94%) rename core/src/main/scalajvm/sttp/{client => client3}/SttpExtensions.scala (95%) rename core/src/main/scalajvm/sttp/{client => client3}/TryHttpURLConnectionBackend.scala (85%) rename core/src/main/scalajvm/sttp/{client => client3}/internal/FileHelpers.scala (94%) rename core/src/main/scalajvm/sttp/{client => client3}/internal/MessageDigestCompatibility.scala (62%) rename core/src/main/scalajvm/sttp/{client => client3}/internal/SttpFileExtensions.scala (95%) rename core/src/main/scalajvm/sttp/{client => client3}/quick.scala (83%) delete mode 100644 core/src/main/scalanative/sttp/client/curl/CurlList.scala rename core/src/main/scalanative/sttp/{client => client3}/AbstractCurlBackend.scala (96%) rename core/src/main/scalanative/sttp/{client => client3}/CurlBackends.scala (93%) rename core/src/main/scalanative/sttp/{client => client3}/FileHelpers.scala (80%) rename core/src/main/scalanative/sttp/{client => client3}/RequestTExtensions.scala (95%) rename core/src/main/scalanative/sttp/{client => client3}/SttpExtensions.scala (95%) rename core/src/main/scalanative/sttp/{client => client3}/curl/CCurl.scala (96%) rename core/src/main/scalanative/sttp/{client => client3}/curl/CurlApi.scala (95%) rename core/src/main/scalanative/sttp/{client => client3}/curl/CurlCode.scala (98%) rename core/src/main/scalanative/sttp/{client => client3}/curl/CurlInfo.scala (97%) create mode 100644 core/src/main/scalanative/sttp/client3/curl/CurlList.scala rename core/src/main/scalanative/sttp/{client => client3}/curl/CurlOption.scala (99%) rename core/src/main/scalanative/sttp/{client => client3}/curl/CurlSpaces.scala (84%) rename core/src/main/scalanative/sttp/{client => client3}/curl/package.scala (90%) rename core/src/main/scalanative/sttp/{client => client3}/internal/CryptoMd5.scala (94%) rename core/src/main/scalanative/sttp/{client => client3}/internal/MessageDigestCompatibility.scala (59%) rename core/src/main/scalanative/sttp/{client => client3}/internal/SttpFileExtensions.scala (95%) rename core/src/main/scalanative/sttp/{client => client3}/quick.scala (82%) rename core/src/test/scala/sttp/{client => client3}/FollowRedirectsBackendTest.scala (97%) rename core/src/test/scala/sttp/{client => client3}/RequestTests.scala (99%) rename core/src/test/scala/sttp/{client => client3}/RetryWhenDefaultTest.scala (79%) rename core/src/test/scala/sttp/{client => client3}/SttpBackendOptionsProxyTest.scala (98%) rename core/src/test/scala/sttp/{client => client3}/ToCurlConverterTest.scala (99%) rename core/src/test/scala/sttp/{client => client3}/internal/DigestAuthenticatorTest.scala (98%) rename core/src/test/scala/sttp/{client => client3}/internal/WwwAuthHeaderParserTest.scala (98%) rename core/src/test/scala/sttp/{client => client3}/testing/CancelTest.scala (91%) rename core/src/test/scala/sttp/{client => client3}/testing/ConvertToFuture.scala (91%) rename core/src/test/scala/sttp/{client => client3}/testing/HttpTest.scala (98%) rename core/src/test/scala/sttp/{client => client3}/testing/SttpBackendStubTests.scala (99%) rename core/src/test/scala/sttp/{client => client3}/testing/ToFutureWrapper.scala (93%) rename core/src/test/scala/sttp/{client => client3}/testing/streaming/StreamingTest.scala (96%) delete mode 100644 core/src/test/scalajs/sttp/client/testing/streaming/StreamingTestExtensions.scala rename core/src/test/scalajs/sttp/{client => client3}/FetchHttpTest.scala (78%) rename core/src/test/scalajs/sttp/{client => client3}/testing/AbstractFetchHttpTest.scala (94%) rename core/src/test/scalajs/sttp/{client => client3}/testing/AsyncExecutionContext.scala (95%) rename core/src/test/scalajs/sttp/{client => client3}/testing/HttpTestExtensions.scala (94%) rename core/src/test/scalajs/sttp/{client => client3}/testing/Platform.scala (92%) create mode 100644 core/src/test/scalajs/sttp/client3/testing/streaming/StreamingTestExtensions.scala rename core/src/test/scalajvm/sttp/{client => client3}/CookieRequestTests.scala (98%) rename core/src/test/scalajvm/sttp/{client => client3}/HttpURLConnectionBackendHttpTest.scala (85%) rename core/src/test/scalajvm/sttp/{client => client3}/ToCurlConverterTestExtension.scala (89%) rename core/src/test/scalajvm/sttp/{client => client3}/TryHttpURLConnectionHttpTest.scala (71%) rename core/src/test/scalajvm/sttp/{client => client3}/testing/HttpTestExtensions.scala (99%) rename core/src/test/scalajvm/sttp/{client => client3}/testing/Platform.scala (91%) rename core/src/test/scalajvm/sttp/{client => client3}/testing/streaming/StreamingTestExtensions.scala (65%) rename core/src/test/scalajvm/sttp/{client => client3}/testing/websocket/WebSocketBufferOverflowTest.scala (88%) rename core/src/test/scalajvm/sttp/{client => client3}/testing/websocket/WebSocketStreamingTest.scala (94%) rename core/src/test/scalajvm/sttp/{client => client3}/testing/websocket/WebSocketTest.scala (92%) delete mode 100644 core/src/test/scalanative/sttp/client/testing/streaming/StreamingTestExtensions.scala rename core/src/test/scalanative/sttp/{client => client3}/CurlBackendHttpTest.scala (70%) rename core/src/test/scalanative/sttp/{client => client3}/ToCurlConverterTestExtension.scala (65%) rename core/src/test/scalanative/sttp/{client => client3}/testing/AsyncExecutionContext.scala (83%) rename core/src/test/scalanative/sttp/{client => client3}/testing/HttpTestExtensions.scala (76%) rename core/src/test/scalanative/sttp/{client => client3}/testing/Platform.scala (90%) rename core/src/test/scalanative/sttp/{client => client3}/testing/SyncHttpTest.scala (98%) rename core/src/test/scalanative/sttp/{client => client3}/testing/SyncHttpTestExtensions.scala (98%) create mode 100644 core/src/test/scalanative/sttp/client3/testing/streaming/StreamingTestExtensions.scala rename examples/src/main/scala/sttp/{client => client3}/examples/GetAndParseJsonAkkaHttpJson4s.scala (86%) rename examples/src/main/scala/sttp/{client => client3}/examples/GetAndParseJsonGetRightMonixCirce.scala (80%) rename examples/src/main/scala/sttp/{client => client3}/examples/GetAndParseJsonZioCirce.scala (88%) rename examples/src/main/scala/sttp/{client => client3}/examples/GetRawResponseBodySynchronous.scala (89%) rename examples/src/main/scala/sttp/{client => client3}/examples/LogRequestsSlf4j.scala (81%) rename examples/src/main/scala/sttp/{client => client3}/examples/PostFormSynchronous.scala (89%) rename examples/src/main/scala/sttp/{client => client3}/examples/PostSerializeJsonMonixAsyncHttpClientCirce.scala (81%) rename examples/src/main/scala/sttp/{client => client3}/examples/RetryZio.scala (86%) rename examples/src/main/scala/sttp/{client => client3}/examples/StreamFs2.scala (91%) rename examples/src/main/scala/sttp/{client => client3}/examples/StreamZio.scala (87%) rename examples/src/main/scala/sttp/{client => client3}/examples/TestEndpointMultipleQueryParameters.scala (88%) rename examples/src/main/scala/sttp/{client => client3}/examples/WebSocketAkka.scala (86%) rename examples/src/main/scala/sttp/{client => client3}/examples/WebSocketMonix.scala (83%) rename examples/src/main/scala/sttp/{client => client3}/examples/WebSocketStreamFs2.scala (90%) rename examples/src/main/scala/sttp/{client => client3}/examples/WebSocketTesting.scala (89%) rename examples/src/main/scala/sttp/{client => client3}/examples/WebSocketZio.scala (90%) rename finagle-backend/src/main/scala/sttp/{client => client3}/finagle/FinagleBackend.scala (96%) rename finagle-backend/src/test/scala/sttp/{client => client3}/finagle/FinagleBackendTest.scala (86%) rename http4s-backend/src/main/scala/sttp/{client => client3}/http4s/Http4sBackend.scala (97%) rename http4s-backend/src/test/scala/sttp/{client => client3}/http4s/Http4sHttpStreamingTest.scala (81%) rename http4s-backend/src/test/scala/sttp/{client => client3}/http4s/Http4sHttpTest.scala (79%) rename httpclient-backend/fs2/src/main/scala/sttp/{client => client3}/httpclient/fs2/Fs2BodyFromHttpClient.scala (88%) rename httpclient-backend/fs2/src/main/scala/sttp/{client => client3}/httpclient/fs2/HttpClientFs2Backend.scala (89%) rename httpclient-backend/fs2/src/test/scala/sttp/{client => client3}/httpclient/fs2/HttpClientFs2HttpTest.scala (57%) rename httpclient-backend/fs2/src/test/scala/sttp/{client => client3}/httpclient/fs2/HttpClientFs2StreamingTest.scala (66%) rename httpclient-backend/fs2/src/test/scala/sttp/{client => client3}/httpclient/fs2/HttpClientFs2TestBase.scala (73%) rename httpclient-backend/fs2/src/test/scala/sttp/{client => client3}/httpclient/fs2/HttpClientFs2WebSocketTest.scala (59%) rename httpclient-backend/monix/src/main/scala/sttp/{client => client3}/httpclient/monix/HttpClientMonixBackend.scala (91%) rename httpclient-backend/monix/src/test/scala/sttp/{client => client3}/httpclient/monix/HttpClientMonixHttpTest.scala (63%) rename httpclient-backend/monix/src/test/scala/sttp/{client => client3}/httpclient/monix/HttpClientMonixStreamingTest.scala (75%) rename httpclient-backend/monix/src/test/scala/sttp/{client => client3}/httpclient/monix/HttpClientMonixWebSocketTest.scala (82%) rename httpclient-backend/src/main/scala/sttp/{client => client3}/httpclient/BodyFromHttpClient.scala (92%) rename httpclient-backend/src/main/scala/sttp/{client => client3}/httpclient/BodyToHttpClient.scala (97%) rename httpclient-backend/src/main/scala/sttp/{client => client3}/httpclient/DelegatingWebSocketListener.scala (97%) rename httpclient-backend/src/main/scala/sttp/{client => client3}/httpclient/HttpClientAsyncBackend.scala (94%) rename httpclient-backend/src/main/scala/sttp/{client => client3}/httpclient/HttpClientBackend.scala (94%) rename httpclient-backend/src/main/scala/sttp/{client => client3}/httpclient/HttpClientFutureBackend.scala (91%) rename httpclient-backend/src/main/scala/sttp/{client => client3}/httpclient/HttpClientSyncBackend.scala (93%) rename httpclient-backend/src/main/scala/sttp/{client => client3}/httpclient/InputStreamBodyFromHttpClient.scala (89%) rename httpclient-backend/src/main/scala/sttp/{client => client3}/httpclient/InputStreamSubscriber.scala (97%) rename httpclient-backend/src/main/scala/sttp/{client => client3}/httpclient/MultiPartBodyPublisher.java (99%) rename httpclient-backend/src/main/scala/sttp/{client => client3}/httpclient/WebSocketImpl.scala (97%) rename httpclient-backend/src/test/scala/sttp/{client => client3}/httpclient/HttpClientFutureHttpTest.scala (68%) rename httpclient-backend/src/test/scala/sttp/{client => client3}/httpclient/HttpClientFutureWebSocketTest.scala (73%) rename httpclient-backend/src/test/scala/sttp/{client => client3}/httpclient/HttpClientSyncHttpTest.scala (63%) rename httpclient-backend/zio/src/main/scala/sttp/{client => client3}/httpclient/zio/HttpClientZioBackend.scala (92%) rename httpclient-backend/zio/src/main/scala/sttp/{client => client3}/httpclient/zio/ZioBodyFromHttpClient.scala (89%) rename httpclient-backend/zio/src/main/scala/sttp/{client => client3}/httpclient/zio/package.scala (95%) rename httpclient-backend/zio/src/test/scala/sttp/{client => client3}/httpclient/zio/HttpClientZioHttpTest.scala (78%) rename httpclient-backend/zio/src/test/scala/sttp/{client => client3}/httpclient/zio/HttpClientZioStreamingTest.scala (79%) rename httpclient-backend/zio/src/test/scala/sttp/{client => client3}/httpclient/zio/HttpClientZioWebSocketTest.scala (81%) rename httpclient-backend/zio/src/test/scala/sttp/{client => client3}/httpclient/zio/SttpBackendStubZioTests.scala (93%) rename implementations/cats/src/main/scala/sttp/{client => client3}/impl/cats/CatsMonadAsyncError.scala (96%) rename implementations/cats/src/main/scala/sttp/{client => client3}/impl/cats/implicits.scala (90%) rename implementations/cats/src/test/scala/sttp/{client => client3}/impl/cats/CatsTestBase.scala (88%) rename implementations/cats/src/test/scala/sttp/{client => client3}/impl/cats/package.scala (77%) rename implementations/fs2/src/main/scala/sttp/{client => client3}/impl/fs2/Fs2SimpleQueue.scala (87%) rename implementations/fs2/src/main/scala/sttp/{client => client3}/impl/fs2/Fs2WebSockets.scala (98%) rename implementations/fs2/src/test/scala/sttp/{client => client3}/impl/fs2/Fs2StreamingTest.scala (82%) rename implementations/monix/src/main/scala/sttp/{client => client3}/impl/monix/MonixSimpleQueue.scala (88%) rename implementations/monix/src/main/scala/sttp/{client => client3}/impl/monix/MonixWebSockets.scala (98%) rename implementations/monix/src/main/scala/sttp/{client => client3}/impl/monix/TaskMonadAsyncError.scala (97%) rename implementations/monix/src/main/scalajs/sttp/{client => client3}/impl/monix/FetchMonixBackend.scala (95%) rename implementations/monix/src/test/scala/sttp/{client => client3}/impl/monix/MonixStreamingTest.scala (84%) rename implementations/monix/src/test/scala/sttp/{client => client3}/impl/monix/package.scala (81%) rename implementations/monix/src/test/scalajs/{client => client3}/impl/monix/FetchMonixHttpTest.scala (74%) rename implementations/monix/src/test/scalajs/{client => client3}/impl/monix/FetchMonixStreamingTest.scala (81%) rename implementations/scalaz/src/main/scala/sttp/{client => client3}/impl/scalaz/TaskMonadAsyncError.scala (96%) rename implementations/scalaz/src/main/scala/sttp/{client => client3}/impl/scalaz/implicits.scala (89%) rename implementations/scalaz/src/test/scala/sttp/{client => client3}/impl/scalaz/package.scala (88%) rename implementations/zio/src/main/scala/sttp/{client => client3}/impl/zio/RIOMonadAsyncError.scala (97%) rename implementations/zio/src/main/scala/sttp/{client => client3}/impl/zio/SttpClientStubbingBase.scala (96%) rename implementations/zio/src/main/scala/sttp/{client => client3}/impl/zio/ZioSimpleQueue.scala (83%) rename implementations/zio/src/main/scala/sttp/{client => client3}/impl/zio/ZioWebSockets.scala (92%) rename implementations/zio/src/main/scala/sttp/{client => client3}/impl/zio/package.scala (90%) rename implementations/zio/src/test/scala/sttp/{client => client3}/impl/zio/ZioTestBase.scala (94%) rename json/circe/src/main/scala/sttp/{client => client3}/circe/SttpCirceApi.scala (95%) rename json/circe/src/main/scala/sttp/{client => client3}/circe/package.scala (67%) rename json/circe/src/test/scala/sttp/{client => client3}/circe/CirceTests.scala (98%) rename json/circe/src/test/scala/sttp/{client => client3}/circe/SttpBackendStubCirceTests.scala (86%) rename json/common/src/main/scala/sttp/{client => client3}/IsOption.scala (96%) rename json/common/src/main/scala/sttp/{client => client3}/JsonInput.scala (89%) rename json/common/src/main/scala/sttp/{client => client3}/json/package.scala (93%) rename json/json4s/src/main/scala/sttp/{client => client3}/json4s/SttpJson4sApi.scala (95%) rename json/json4s/src/main/scala/sttp/{client => client3}/json4s/package.scala (68%) rename json/json4s/src/test/scala/sttp/{client => client3}/Json4sTests.scala (98%) rename json/play-json/src/main/scala/sttp/{client => client3}/playJson/SttpPlayJsonApi.scala (95%) rename json/play-json/src/main/scala/sttp/{client => client3}/playJson/package.scala (70%) rename json/play-json/src/test/scala/sttp/{client => client3}/PlayJsonTests.scala (93%) rename json/spray-json/src/main/scala/sttp/{client => client3}/sprayJson/SttpSprayJsonApi.scala (94%) rename json/spray-json/src/main/scala/sttp/{client => client3}/sprayJson/package.scala (70%) rename json/spray-json/src/test/scala/sttp/{client => client3}/SprayJsonTests.scala (96%) rename logging/scribe/src/main/scala/sttp/{client => client3}/logging/scribe/ScribeLogger.scala (92%) rename logging/scribe/src/main/scala/sttp/{client => client3}/logging/scribe/ScribeLoggingBackend.scala (85%) rename logging/slf4j/src/main/scala/sttp/{client => client3}/logging/slf4j/Slf4jLogger.scala (95%) rename logging/slf4j/src/main/scala/sttp/{client => client3}/logging/slf4j/Slf4jLoggingBackend.scala (72%) rename metrics/open-tracing-backend/src/main/scala/sttp/{client => client3}/opentracing/OpenTracingBackend.scala (95%) rename metrics/open-tracing-backend/src/main/scala/sttp/{client => client3}/opentracing/RequestBuilderCarrier.scala (89%) rename metrics/open-tracing-backend/src/test/scala/sttp/{client => client3}/opentracing/OpenTracingBackendTest.scala (96%) rename metrics/prometheus-backend/src/main/scala/sttp/{client => client3}/prometheus/PrometheusBackend.scala (96%) rename metrics/prometheus-backend/src/test/scala/sttp/{client => client3}/prometheus/PrometheusBackendTest.scala (98%) rename metrics/zio-telemetry-open-tracing-backend/src/main/scala/sttp/{client => client3}/ziotelemetry/opentracing/ZioTelemetryOpenTracingBackend.scala (93%) rename okhttp-backend/monix/src/main/scala/sttp/{client => client3}/okhttp/monix/OkHttpMonixBackend.scala (93%) rename okhttp-backend/monix/src/test/scala/sttp/{client => client3}/okhttp/monix/OkHttpMonixHttpTest.scala (66%) rename okhttp-backend/monix/src/test/scala/sttp/{client => client3}/okhttp/monix/OkHttpMonixStreamingTest.scala (70%) rename okhttp-backend/monix/src/test/scala/sttp/{client => client3}/okhttp/monix/OkHttpMonixWebSocketTest.scala (83%) rename okhttp-backend/src/main/scala/sttp/{client => client3}/okhttp/BodyFromOkHttp.scala (93%) rename okhttp-backend/src/main/scala/sttp/{client => client3}/okhttp/BodyToOkHttp.scala (97%) rename okhttp-backend/src/main/scala/sttp/{client => client3}/okhttp/OkHttpAsyncBackend.scala (93%) rename okhttp-backend/src/main/scala/sttp/{client => client3}/okhttp/OkHttpBackend.scala (95%) rename okhttp-backend/src/main/scala/sttp/{client => client3}/okhttp/OkHttpFutureBackend.scala (90%) rename okhttp-backend/src/main/scala/sttp/{client => client3}/okhttp/OkHttpSyncBackend.scala (94%) rename okhttp-backend/src/main/scala/sttp/{client => client3}/okhttp/WebSocketImpl.scala (98%) rename okhttp-backend/src/main/scala/sttp/{client => client3}/okhttp/quick.scala (74%) rename okhttp-backend/src/test/scala/sttp/{client => client3}/okhttp/OkHttpFutureHttpTest.scala (71%) rename okhttp-backend/src/test/scala/sttp/{client => client3}/okhttp/OkHttpFutureWebsocketTest.scala (83%) rename okhttp-backend/src/test/scala/sttp/{client => client3}/okhttp/OkHttpSyncDigestAuthProxyManualTest.scala (88%) rename okhttp-backend/src/test/scala/sttp/{client => client3}/okhttp/OkHttpSyncHttpTest.scala (67%) rename okhttp-backend/src/test/scala/sttp/{client => client3}/okhttp/OkHttpSyncWebSocketTest.scala (84%) rename testing/compile/src/test/scala/sttp/{client => client3}/testing/compile/EvalScala.scala (84%) rename testing/compile/src/test/scala/sttp/{client => client3}/testing/compile/IllTypedTests.scala (82%) rename testing/server/src/main/scala/sttp/{client => client3}/testing/server/HttpServer.scala (94%) diff --git a/README.md b/README.md index 4b71652b3e..4446164137 100755 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Join the chat at https://gitter.im/softwaremill/sttp](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/softwaremill/sttp?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Build Status](https://travis-ci.org/softwaremill/sttp.svg?branch=master)](https://travis-ci.org/softwaremill/sttp) -[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.softwaremill.sttp.client/core_2.12/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.softwaremill.sttp.client/core_2.12) +[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.softwaremill.sttp.client3/core_2.12/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.softwaremill.sttp.client3/core_2.12) The Scala HTTP client that you always wanted! @@ -16,7 +16,7 @@ Backend implementations include ones based on [akka-http](https://doc.akka.io/do Here's a very quick example of sttp client in action: ```scala -import sttp.client._ +import sttp.client3._ val sort: Option[String] = None val query = "http language:scala" @@ -37,19 +37,21 @@ println(response.body) ## Documentation -sttp (v2) documentation is available at [sttp.softwaremill.com](http://sttp.softwaremill.com). +sttp (v3) documentation is available at [sttp.softwaremill.com](http://sttp.softwaremill.com). + +sttp (v2) documentation is available at [sttp.softwaremill.com/en/v2](http://sttp.softwaremill.com/en/v2). sttp (v1) documentation is available at [sttp.softwaremill.com/en/v1](https://sttp.softwaremill.com/en/v1). -scaladoc is available at [https://www.javadoc.io](https://www.javadoc.io/doc/com.softwaremill.sttp.client/core_2.12/3.0.0-RC3) +scaladoc is available at [https://www.javadoc.io](https://www.javadoc.io/doc/com.softwaremill.sttp.client3/core_2.12/3.0.0-RC3) ## Quickstart with Ammonite If you are an [Ammonite](http://ammonite.io) user, you can quickly start experimenting with sttp by copy-pasting the following: ```scala -import $ivy.`com.softwaremill.sttp.client::core:3.0.0-RC3` -import sttp.client.quick._ +import $ivy.`com.softwaremill.sttp.client3::core:3.0.0-RC3` +import sttp.client3.quick._ quickRequest.get(uri"http://httpbin.org/ip").send(backend) ``` @@ -60,13 +62,13 @@ This brings in the sttp API and an implicit, synchronous backend. Add the following dependency: ```scala -"com.softwaremill.sttp.client" %% "core" % "3.0.0-RC3" +"com.softwaremill.sttp.client3" %% "core" % "3.0.0-RC3" ``` Then, import: ```scala -import sttp.client._ +import sttp.client3._ ``` Type `sttp.` and see where your IDE’s auto-complete gets you! diff --git a/akka-http-backend/src/main/scala/sttp/client/akkahttp/AkkaHttpBackend.scala b/akka-http-backend/src/main/scala/sttp/client3/akkahttp/AkkaHttpBackend.scala similarity index 96% rename from akka-http-backend/src/main/scala/sttp/client/akkahttp/AkkaHttpBackend.scala rename to akka-http-backend/src/main/scala/sttp/client3/akkahttp/AkkaHttpBackend.scala index 1223d8bf57..1235982e2d 100644 --- a/akka-http-backend/src/main/scala/sttp/client/akkahttp/AkkaHttpBackend.scala +++ b/akka-http-backend/src/main/scala/sttp/client3/akkahttp/AkkaHttpBackend.scala @@ -1,4 +1,4 @@ -package sttp.client.akkahttp +package sttp.client3.akkahttp import java.io.UnsupportedEncodingException @@ -15,10 +15,10 @@ import akka.stream.Materializer import akka.stream.scaladsl.Flow import sttp.capabilities.akka.AkkaStreams import sttp.capabilities.{Effect, WebSockets} -import sttp.client -import sttp.client.akkahttp.AkkaHttpBackend.EncodingHandler -import sttp.client.testing.SttpBackendStub -import sttp.client.{FollowRedirectsBackend, Response, SttpBackend, SttpBackendOptions, _} +import sttp.client3 +import sttp.client3.akkahttp.AkkaHttpBackend.EncodingHandler +import sttp.client3.testing.SttpBackendStub +import sttp.client3.{FollowRedirectsBackend, Response, SttpBackend, SttpBackendOptions, _} import sttp.model.StatusCode import sttp.monad.{FutureMonad, MonadError} @@ -115,10 +115,10 @@ class AkkaHttpBackend private ( val headers = FromAkka.headers(hr) - val responseMetadata = client.ResponseMetadata(headers, code, statusText) + val responseMetadata = client3.ResponseMetadata(headers, code, statusText) val body = bodyFromAkka(r.response, responseMetadata, wsFlow.map(Right(_)).getOrElse(Left(decodeAkkaResponse(hr)))) - body.map(client.Response(_, code, statusText, headers, Nil, r.onlyMetadata)) + body.map(client3.Response(_, code, statusText, headers, Nil, r.onlyMetadata)) } // http://doc.akka.io/docs/akka-http/10.0.7/scala/http/common/de-coding.html diff --git a/akka-http-backend/src/main/scala/sttp/client/akkahttp/AkkaHttpClient.scala b/akka-http-backend/src/main/scala/sttp/client3/akkahttp/AkkaHttpClient.scala similarity index 99% rename from akka-http-backend/src/main/scala/sttp/client/akkahttp/AkkaHttpClient.scala rename to akka-http-backend/src/main/scala/sttp/client3/akkahttp/AkkaHttpClient.scala index 26aa3d25f2..539731c775 100644 --- a/akka-http-backend/src/main/scala/sttp/client/akkahttp/AkkaHttpClient.scala +++ b/akka-http-backend/src/main/scala/sttp/client3/akkahttp/AkkaHttpClient.scala @@ -1,4 +1,4 @@ -package sttp.client.akkahttp +package sttp.client3.akkahttp import akka.actor.ActorSystem import akka.event.LoggingAdapter diff --git a/akka-http-backend/src/main/scala/sttp/client/akkahttp/BodyFromAkka.scala b/akka-http-backend/src/main/scala/sttp/client3/akkahttp/BodyFromAkka.scala similarity index 97% rename from akka-http-backend/src/main/scala/sttp/client/akkahttp/BodyFromAkka.scala rename to akka-http-backend/src/main/scala/sttp/client3/akkahttp/BodyFromAkka.scala index 1321b3d3c8..2c199e5376 100644 --- a/akka-http-backend/src/main/scala/sttp/client/akkahttp/BodyFromAkka.scala +++ b/akka-http-backend/src/main/scala/sttp/client3/akkahttp/BodyFromAkka.scala @@ -1,4 +1,4 @@ -package sttp.client.akkahttp +package sttp.client3.akkahttp import java.util.concurrent.atomic.AtomicBoolean @@ -9,9 +9,9 @@ import akka.stream.{Materializer, OverflowStrategy, QueueOfferResult} import akka.util.ByteString import akka.{Done, NotUsed} import sttp.capabilities.akka.AkkaStreams -import sttp.client.internal.{BodyFromResponseAs, SttpFile} -import sttp.client.ws.{GotAWebSocketException, NotAWebSocketException} -import sttp.client.{ +import sttp.client3.internal.{BodyFromResponseAs, SttpFile} +import sttp.client3.ws.{GotAWebSocketException, NotAWebSocketException} +import sttp.client3.{ ResponseAs, ResponseAsWebSocket, ResponseAsWebSocketStream, diff --git a/akka-http-backend/src/main/scala/sttp/client/akkahttp/BodyToAkka.scala b/akka-http-backend/src/main/scala/sttp/client3/akkahttp/BodyToAkka.scala similarity index 97% rename from akka-http-backend/src/main/scala/sttp/client/akkahttp/BodyToAkka.scala rename to akka-http-backend/src/main/scala/sttp/client3/akkahttp/BodyToAkka.scala index 25a1e59fb8..0a5167f394 100644 --- a/akka-http-backend/src/main/scala/sttp/client/akkahttp/BodyToAkka.scala +++ b/akka-http-backend/src/main/scala/sttp/client3/akkahttp/BodyToAkka.scala @@ -1,4 +1,4 @@ -package sttp.client.akkahttp +package sttp.client3.akkahttp import akka.http.scaladsl.model.{ ContentType, @@ -12,8 +12,8 @@ import akka.http.scaladsl.model.{ import akka.stream.scaladsl.{Source, StreamConverters} import akka.util.ByteString import sttp.capabilities.akka.AkkaStreams -import sttp.client.internal.throwNestedMultipartNotAllowed -import sttp.client.{ +import sttp.client3.internal.throwNestedMultipartNotAllowed +import sttp.client3.{ ByteArrayBody, ByteBufferBody, FileBody, diff --git a/akka-http-backend/src/main/scala/sttp/client/akkahttp/FromAkka.scala b/akka-http-backend/src/main/scala/sttp/client3/akkahttp/FromAkka.scala similarity index 93% rename from akka-http-backend/src/main/scala/sttp/client/akkahttp/FromAkka.scala rename to akka-http-backend/src/main/scala/sttp/client3/akkahttp/FromAkka.scala index 4ea298d5eb..f7d154aac3 100644 --- a/akka-http-backend/src/main/scala/sttp/client/akkahttp/FromAkka.scala +++ b/akka-http-backend/src/main/scala/sttp/client3/akkahttp/FromAkka.scala @@ -1,7 +1,7 @@ -package sttp.client.akkahttp +package sttp.client3.akkahttp import akka.http.scaladsl.model.HttpResponse -import sttp.client.{Request, SttpClientException} +import sttp.client3.{Request, SttpClientException} import sttp.model.{Header, HeaderNames} import scala.collection.immutable.Seq diff --git a/akka-http-backend/src/main/scala/sttp/client/akkahttp/ToAkka.scala b/akka-http-backend/src/main/scala/sttp/client3/akkahttp/ToAkka.scala similarity index 96% rename from akka-http-backend/src/main/scala/sttp/client/akkahttp/ToAkka.scala rename to akka-http-backend/src/main/scala/sttp/client3/akkahttp/ToAkka.scala index daf9c00418..d8a852630d 100644 --- a/akka-http-backend/src/main/scala/sttp/client/akkahttp/ToAkka.scala +++ b/akka-http-backend/src/main/scala/sttp/client3/akkahttp/ToAkka.scala @@ -1,8 +1,8 @@ -package sttp.client.akkahttp +package sttp.client3.akkahttp import akka.http.scaladsl.model.{HttpHeader, HttpMethod, HttpMethods, HttpRequest} import akka.http.scaladsl.model.HttpHeader.ParsingResult -import sttp.client.Request +import sttp.client3.Request import sttp.model.{Header, Method} import scala.collection.immutable.Seq diff --git a/akka-http-backend/src/main/scala/sttp/client/akkahttp/Util.scala b/akka-http-backend/src/main/scala/sttp/client3/akkahttp/Util.scala similarity index 96% rename from akka-http-backend/src/main/scala/sttp/client/akkahttp/Util.scala rename to akka-http-backend/src/main/scala/sttp/client3/akkahttp/Util.scala index 5443fda7dd..60fc7864f1 100644 --- a/akka-http-backend/src/main/scala/sttp/client/akkahttp/Util.scala +++ b/akka-http-backend/src/main/scala/sttp/client3/akkahttp/Util.scala @@ -1,9 +1,9 @@ -package sttp.client.akkahttp +package sttp.client3.akkahttp import akka.http.scaladsl.model.ContentType import akka.http.scaladsl.model.ContentTypes.`application/octet-stream` import akka.http.scaladsl.model.headers.{`Content-Length`, `Content-Type`} -import sttp.client.Request +import sttp.client3.Request import sttp.model.Header import scala.collection.immutable.Seq diff --git a/akka-http-backend/src/test/scala/sttp/client/akkahttp/AkkaHttpClientHttpTest.scala b/akka-http-backend/src/test/scala/sttp/client3/akkahttp/AkkaHttpClientHttpTest.scala similarity index 68% rename from akka-http-backend/src/test/scala/sttp/client/akkahttp/AkkaHttpClientHttpTest.scala rename to akka-http-backend/src/test/scala/sttp/client3/akkahttp/AkkaHttpClientHttpTest.scala index 19d1853c54..16fea3f236 100644 --- a/akka-http-backend/src/test/scala/sttp/client/akkahttp/AkkaHttpClientHttpTest.scala +++ b/akka-http-backend/src/test/scala/sttp/client3/akkahttp/AkkaHttpClientHttpTest.scala @@ -1,7 +1,7 @@ -package sttp.client.akkahttp +package sttp.client3.akkahttp -import sttp.client.SttpBackend -import sttp.client.testing.{ConvertToFuture, HttpTest} +import sttp.client3.SttpBackend +import sttp.client3.testing.{ConvertToFuture, HttpTest} import scala.concurrent.Future diff --git a/akka-http-backend/src/test/scala/sttp/client/akkahttp/AkkaHttpRouteBackendTest.scala b/akka-http-backend/src/test/scala/sttp/client3/akkahttp/AkkaHttpRouteBackendTest.scala similarity index 94% rename from akka-http-backend/src/test/scala/sttp/client/akkahttp/AkkaHttpRouteBackendTest.scala rename to akka-http-backend/src/test/scala/sttp/client3/akkahttp/AkkaHttpRouteBackendTest.scala index 14eff2ae44..eee6413e01 100644 --- a/akka-http-backend/src/test/scala/sttp/client/akkahttp/AkkaHttpRouteBackendTest.scala +++ b/akka-http-backend/src/test/scala/sttp/client3/akkahttp/AkkaHttpRouteBackendTest.scala @@ -1,9 +1,9 @@ -package sttp.client.akkahttp +package sttp.client3.akkahttp import akka.actor.ActorSystem import akka.http.scaladsl.server.Route import org.scalatest.BeforeAndAfterAll -import sttp.client.SttpBackend +import sttp.client3.SttpBackend import sttp.model.StatusCode import scala.concurrent.duration._ @@ -22,7 +22,7 @@ class AkkaHttpRouteBackendTest extends AsyncWordSpec with Matchers with BeforeAn val backend: SttpBackend[Future, Any] = AkkaHttpBackend.usingClient(system, http = AkkaHttpClient.stubFromRoute(Routes.route)) - import sttp.client._ + import sttp.client3._ "matched route" should { diff --git a/akka-http-backend/src/test/scala/sttp/client/akkahttp/AkkaHttpStreamingTest.scala b/akka-http-backend/src/test/scala/sttp/client3/akkahttp/AkkaHttpStreamingTest.scala similarity index 84% rename from akka-http-backend/src/test/scala/sttp/client/akkahttp/AkkaHttpStreamingTest.scala rename to akka-http-backend/src/test/scala/sttp/client3/akkahttp/AkkaHttpStreamingTest.scala index 516706c771..cb047fe162 100644 --- a/akka-http-backend/src/test/scala/sttp/client/akkahttp/AkkaHttpStreamingTest.scala +++ b/akka-http-backend/src/test/scala/sttp/client3/akkahttp/AkkaHttpStreamingTest.scala @@ -1,12 +1,12 @@ -package sttp.client.akkahttp +package sttp.client3.akkahttp import akka.actor.ActorSystem import akka.stream.scaladsl.Source import akka.util.ByteString import sttp.capabilities.akka.AkkaStreams -import sttp.client.SttpBackend -import sttp.client.testing.ConvertToFuture -import sttp.client.testing.streaming.StreamingTest +import sttp.client3.SttpBackend +import sttp.client3.testing.ConvertToFuture +import sttp.client3.testing.streaming.StreamingTest import scala.concurrent.Future diff --git a/akka-http-backend/src/test/scala/sttp/client/akkahttp/AkkaHttpWebSocketTest.scala b/akka-http-backend/src/test/scala/sttp/client3/akkahttp/AkkaHttpWebSocketTest.scala similarity index 89% rename from akka-http-backend/src/test/scala/sttp/client/akkahttp/AkkaHttpWebSocketTest.scala rename to akka-http-backend/src/test/scala/sttp/client3/akkahttp/AkkaHttpWebSocketTest.scala index 1c307b7258..45a4e8dbe7 100644 --- a/akka-http-backend/src/test/scala/sttp/client/akkahttp/AkkaHttpWebSocketTest.scala +++ b/akka-http-backend/src/test/scala/sttp/client3/akkahttp/AkkaHttpWebSocketTest.scala @@ -1,12 +1,12 @@ -package sttp.client.akkahttp +package sttp.client3.akkahttp import akka.NotUsed import akka.stream.scaladsl.{Flow, Source} import sttp.capabilities.WebSockets import sttp.capabilities.akka.AkkaStreams -import sttp.client._ -import sttp.client.testing.ConvertToFuture -import sttp.client.testing.websocket.{WebSocketStreamingTest, WebSocketTest} +import sttp.client3._ +import sttp.client3.testing.ConvertToFuture +import sttp.client3.testing.websocket.{WebSocketStreamingTest, WebSocketTest} import sttp.monad.{FutureMonad, MonadError} import sttp.ws.WebSocketFrame diff --git a/akka-http-backend/src/test/scala/sttp/client/akkahttp/SttpBackendStubAkkaTests.scala b/akka-http-backend/src/test/scala/sttp/client3/akkahttp/SttpBackendStubAkkaTests.scala similarity index 95% rename from akka-http-backend/src/test/scala/sttp/client/akkahttp/SttpBackendStubAkkaTests.scala rename to akka-http-backend/src/test/scala/sttp/client3/akkahttp/SttpBackendStubAkkaTests.scala index 89f11e4ed5..6b3cb734d2 100644 --- a/akka-http-backend/src/test/scala/sttp/client/akkahttp/SttpBackendStubAkkaTests.scala +++ b/akka-http-backend/src/test/scala/sttp/client3/akkahttp/SttpBackendStubAkkaTests.scala @@ -1,11 +1,11 @@ -package sttp.client.akkahttp +package sttp.client3.akkahttp import akka.actor.ActorSystem import org.scalatest.BeforeAndAfterAll import org.scalatest.concurrent.ScalaFutures import org.scalatest.flatspec.AnyFlatSpec import org.scalatest.matchers.should.Matchers -import sttp.client._ +import sttp.client3._ import scala.concurrent.Await import scala.concurrent.ExecutionContext.Implicits.global diff --git a/async-http-client-backend/cats/src/main/scala/sttp/client/asynchttpclient/cats/AsyncHttpClientCatsBackend.scala b/async-http-client-backend/cats/src/main/scala/sttp/client3/asynchttpclient/cats/AsyncHttpClientCatsBackend.scala similarity index 94% rename from async-http-client-backend/cats/src/main/scala/sttp/client/asynchttpclient/cats/AsyncHttpClientCatsBackend.scala rename to async-http-client-backend/cats/src/main/scala/sttp/client3/asynchttpclient/cats/AsyncHttpClientCatsBackend.scala index 19c7dc8ac4..3e6e24967a 100644 --- a/async-http-client-backend/cats/src/main/scala/sttp/client/asynchttpclient/cats/AsyncHttpClientCatsBackend.scala +++ b/async-http-client-backend/cats/src/main/scala/sttp/client3/asynchttpclient/cats/AsyncHttpClientCatsBackend.scala @@ -1,4 +1,4 @@ -package sttp.client.asynchttpclient.cats +package sttp.client3.asynchttpclient.cats import java.io.{ByteArrayInputStream, File} import java.nio.ByteBuffer @@ -14,13 +14,13 @@ import org.asynchttpclient.{ DefaultAsyncHttpClientConfig } import org.reactivestreams.Publisher -import sttp.client.asynchttpclient.{AsyncHttpClientBackend, BodyFromAHC, BodyToAHC} -import sttp.client.impl.cats.CatsMonadAsyncError -import sttp.client.internal.{FileHelpers, NoStreams} -import sttp.client.{FollowRedirectsBackend, Request, Response, SttpBackend, SttpBackendOptions} +import sttp.client3.asynchttpclient.{AsyncHttpClientBackend, BodyFromAHC, BodyToAHC} +import sttp.client3.impl.cats.CatsMonadAsyncError +import sttp.client3.internal.{FileHelpers, NoStreams} +import sttp.client3.{FollowRedirectsBackend, Request, Response, SttpBackend, SttpBackendOptions} import cats.implicits._ -import sttp.client.internal.ws.SimpleQueue -import sttp.client.testing.SttpBackendStub +import sttp.client3.internal.ws.SimpleQueue +import sttp.client3.testing.SttpBackendStub import sttp.monad.MonadAsyncError import sttp.ws.WebSocket diff --git a/async-http-client-backend/cats/src/test/scala/sttp/client/asynchttpclient/cats/AsyncHttpClientCatsHttpTest.scala b/async-http-client-backend/cats/src/test/scala/sttp/client3/asynchttpclient/cats/AsyncHttpClientCatsHttpTest.scala similarity index 84% rename from async-http-client-backend/cats/src/test/scala/sttp/client/asynchttpclient/cats/AsyncHttpClientCatsHttpTest.scala rename to async-http-client-backend/cats/src/test/scala/sttp/client3/asynchttpclient/cats/AsyncHttpClientCatsHttpTest.scala index 96d1527048..15fad7f0f4 100644 --- a/async-http-client-backend/cats/src/test/scala/sttp/client/asynchttpclient/cats/AsyncHttpClientCatsHttpTest.scala +++ b/async-http-client-backend/cats/src/test/scala/sttp/client3/asynchttpclient/cats/AsyncHttpClientCatsHttpTest.scala @@ -1,11 +1,11 @@ -package sttp.client.asynchttpclient.cats +package sttp.client3.asynchttpclient.cats import java.util.concurrent.TimeoutException import cats.effect.IO -import sttp.client._ -import sttp.client.impl.cats.CatsTestBase -import sttp.client.testing.{CancelTest, HttpTest} +import sttp.client3._ +import sttp.client3.impl.cats.CatsTestBase +import sttp.client3.testing.{CancelTest, HttpTest} import scala.concurrent.duration._ diff --git a/async-http-client-backend/fs2/src/main/scala/sttp/client/asynchttpclient/fs2/AsyncHttpClientFs2Backend.scala b/async-http-client-backend/fs2/src/main/scala/sttp/client3/asynchttpclient/fs2/AsyncHttpClientFs2Backend.scala similarity index 95% rename from async-http-client-backend/fs2/src/main/scala/sttp/client/asynchttpclient/fs2/AsyncHttpClientFs2Backend.scala rename to async-http-client-backend/fs2/src/main/scala/sttp/client3/asynchttpclient/fs2/AsyncHttpClientFs2Backend.scala index 292e7d1cb6..50d34a1cc1 100644 --- a/async-http-client-backend/fs2/src/main/scala/sttp/client/asynchttpclient/fs2/AsyncHttpClientFs2Backend.scala +++ b/async-http-client-backend/fs2/src/main/scala/sttp/client3/asynchttpclient/fs2/AsyncHttpClientFs2Backend.scala @@ -1,4 +1,4 @@ -package sttp.client.asynchttpclient.fs2 +package sttp.client3.asynchttpclient.fs2 import java.io.File import java.nio.ByteBuffer @@ -14,13 +14,13 @@ import org.asynchttpclient.{Request => _, Response => _, _} import org.reactivestreams.Publisher import sttp.capabilities.WebSockets import sttp.capabilities.fs2.Fs2Streams -import sttp.client.asynchttpclient.{AsyncHttpClientBackend, BodyFromAHC, BodyToAHC} -import sttp.client.impl.cats.CatsMonadAsyncError -import sttp.client.impl.fs2.{Fs2SimpleQueue, Fs2WebSockets} -import sttp.client.internal._ -import sttp.client.internal.ws.SimpleQueue -import sttp.client.testing.SttpBackendStub -import sttp.client.{FollowRedirectsBackend, SttpBackend, SttpBackendOptions, _} +import sttp.client3.asynchttpclient.{AsyncHttpClientBackend, BodyFromAHC, BodyToAHC} +import sttp.client3.impl.cats.CatsMonadAsyncError +import sttp.client3.impl.fs2.{Fs2SimpleQueue, Fs2WebSockets} +import sttp.client3.internal._ +import sttp.client3.internal.ws.SimpleQueue +import sttp.client3.testing.SttpBackendStub +import sttp.client3.{FollowRedirectsBackend, SttpBackend, SttpBackendOptions, _} import sttp.monad.MonadAsyncError import sttp.ws.{WebSocket, WebSocketFrame} diff --git a/async-http-client-backend/fs2/src/test/scala/sttp/client/asynchttpclient/fs2/AsyncHttpClientFs2HttpStreamingTest.scala b/async-http-client-backend/fs2/src/test/scala/sttp/client3/asynchttpclient/fs2/AsyncHttpClientFs2HttpStreamingTest.scala similarity index 82% rename from async-http-client-backend/fs2/src/test/scala/sttp/client/asynchttpclient/fs2/AsyncHttpClientFs2HttpStreamingTest.scala rename to async-http-client-backend/fs2/src/test/scala/sttp/client3/asynchttpclient/fs2/AsyncHttpClientFs2HttpStreamingTest.scala index 2b970b329e..795abce8bb 100644 --- a/async-http-client-backend/fs2/src/test/scala/sttp/client/asynchttpclient/fs2/AsyncHttpClientFs2HttpStreamingTest.scala +++ b/async-http-client-backend/fs2/src/test/scala/sttp/client3/asynchttpclient/fs2/AsyncHttpClientFs2HttpStreamingTest.scala @@ -1,9 +1,9 @@ -package sttp.client.asynchttpclient.fs2 +package sttp.client3.asynchttpclient.fs2 import cats.effect.{Blocker, ContextShift, IO} import sttp.capabilities.fs2.Fs2Streams -import sttp.client.impl.fs2.Fs2StreamingTest -import sttp.client.SttpBackend +import sttp.client3.impl.fs2.Fs2StreamingTest +import sttp.client3.SttpBackend import scala.concurrent.ExecutionContext import scala.concurrent.ExecutionContext.global diff --git a/async-http-client-backend/fs2/src/test/scala/sttp/client/asynchttpclient/fs2/AsyncHttpClientFs2HttpTest.scala b/async-http-client-backend/fs2/src/test/scala/sttp/client3/asynchttpclient/fs2/AsyncHttpClientFs2HttpTest.scala similarity index 69% rename from async-http-client-backend/fs2/src/test/scala/sttp/client/asynchttpclient/fs2/AsyncHttpClientFs2HttpTest.scala rename to async-http-client-backend/fs2/src/test/scala/sttp/client3/asynchttpclient/fs2/AsyncHttpClientFs2HttpTest.scala index 54a748c483..9f6ff29030 100644 --- a/async-http-client-backend/fs2/src/test/scala/sttp/client/asynchttpclient/fs2/AsyncHttpClientFs2HttpTest.scala +++ b/async-http-client-backend/fs2/src/test/scala/sttp/client3/asynchttpclient/fs2/AsyncHttpClientFs2HttpTest.scala @@ -1,9 +1,9 @@ -package sttp.client.asynchttpclient.fs2 +package sttp.client3.asynchttpclient.fs2 import cats.effect.{Blocker, IO} -import sttp.client.SttpBackend -import sttp.client.impl.cats.CatsTestBase -import sttp.client.testing.HttpTest +import sttp.client3.SttpBackend +import sttp.client3.impl.cats.CatsTestBase +import sttp.client3.testing.HttpTest import scala.concurrent.ExecutionContext.global diff --git a/async-http-client-backend/fs2/src/test/scala/sttp/client/asynchttpclient/fs2/AsyncHttpClientFs2WebSocketTest.scala b/async-http-client-backend/fs2/src/test/scala/sttp/client3/asynchttpclient/fs2/AsyncHttpClientFs2WebSocketTest.scala similarity index 87% rename from async-http-client-backend/fs2/src/test/scala/sttp/client/asynchttpclient/fs2/AsyncHttpClientFs2WebSocketTest.scala rename to async-http-client-backend/fs2/src/test/scala/sttp/client3/asynchttpclient/fs2/AsyncHttpClientFs2WebSocketTest.scala index ddbfd602ff..9410b61113 100644 --- a/async-http-client-backend/fs2/src/test/scala/sttp/client/asynchttpclient/fs2/AsyncHttpClientFs2WebSocketTest.scala +++ b/async-http-client-backend/fs2/src/test/scala/sttp/client3/asynchttpclient/fs2/AsyncHttpClientFs2WebSocketTest.scala @@ -1,14 +1,14 @@ -package sttp.client.asynchttpclient.fs2 +package sttp.client3.asynchttpclient.fs2 import cats.effect.{Blocker, IO} import cats.implicits._ import fs2.Pipe import sttp.capabilities.WebSockets import sttp.capabilities.fs2.Fs2Streams -import sttp.client._ -import sttp.client.asynchttpclient.AsyncHttpClientWebSocketTest -import sttp.client.impl.cats.CatsTestBase -import sttp.client.impl.fs2.Fs2WebSockets +import sttp.client3._ +import sttp.client3.asynchttpclient.AsyncHttpClientWebSocketTest +import sttp.client3.impl.cats.CatsTestBase +import sttp.client3.impl.fs2.Fs2WebSockets import sttp.ws.WebSocketFrame import scala.concurrent.ExecutionContext.global diff --git a/async-http-client-backend/future/src/main/scala/sttp/client/asynchttpclient/future/AsyncHttpClientFutureBackend.scala b/async-http-client-backend/future/src/main/scala/sttp/client3/asynchttpclient/future/AsyncHttpClientFutureBackend.scala similarity index 93% rename from async-http-client-backend/future/src/main/scala/sttp/client/asynchttpclient/future/AsyncHttpClientFutureBackend.scala rename to async-http-client-backend/future/src/main/scala/sttp/client3/asynchttpclient/future/AsyncHttpClientFutureBackend.scala index 04afa924d0..b1d39dcfa7 100644 --- a/async-http-client-backend/future/src/main/scala/sttp/client/asynchttpclient/future/AsyncHttpClientFutureBackend.scala +++ b/async-http-client-backend/future/src/main/scala/sttp/client3/asynchttpclient/future/AsyncHttpClientFutureBackend.scala @@ -1,4 +1,4 @@ -package sttp.client.asynchttpclient.future +package sttp.client3.asynchttpclient.future import java.nio.ByteBuffer @@ -11,11 +11,11 @@ import org.asynchttpclient.{ DefaultAsyncHttpClientConfig } import org.reactivestreams.Publisher -import sttp.client.asynchttpclient.{AsyncHttpClientBackend, BodyFromAHC, BodyToAHC} -import sttp.client.internal.NoStreams -import sttp.client.internal.ws.SimpleQueue -import sttp.client.testing.SttpBackendStub -import sttp.client.{FollowRedirectsBackend, SttpBackend, SttpBackendOptions} +import sttp.client3.asynchttpclient.{AsyncHttpClientBackend, BodyFromAHC, BodyToAHC} +import sttp.client3.internal.NoStreams +import sttp.client3.internal.ws.SimpleQueue +import sttp.client3.testing.SttpBackendStub +import sttp.client3.{FollowRedirectsBackend, SttpBackend, SttpBackendOptions} import sttp.monad.{FutureMonad, MonadAsyncError} import sttp.ws.WebSocket diff --git a/async-http-client-backend/future/src/test/scala/sttp/client/asynchttpclient/future/AsyncHttpClientFutureHttpTest.scala b/async-http-client-backend/future/src/test/scala/sttp/client3/asynchttpclient/future/AsyncHttpClientFutureHttpTest.scala similarity index 71% rename from async-http-client-backend/future/src/test/scala/sttp/client/asynchttpclient/future/AsyncHttpClientFutureHttpTest.scala rename to async-http-client-backend/future/src/test/scala/sttp/client3/asynchttpclient/future/AsyncHttpClientFutureHttpTest.scala index a0e0f97dad..2ce2a8a7b5 100644 --- a/async-http-client-backend/future/src/test/scala/sttp/client/asynchttpclient/future/AsyncHttpClientFutureHttpTest.scala +++ b/async-http-client-backend/future/src/test/scala/sttp/client3/asynchttpclient/future/AsyncHttpClientFutureHttpTest.scala @@ -1,7 +1,7 @@ -package sttp.client.asynchttpclient.future +package sttp.client3.asynchttpclient.future -import sttp.client.SttpBackend -import sttp.client.testing.{ConvertToFuture, HttpTest} +import sttp.client3.SttpBackend +import sttp.client3.testing.{ConvertToFuture, HttpTest} import scala.concurrent.Future diff --git a/async-http-client-backend/monix/src/main/scala/sttp/client/asynchttpclient/monix/AsyncHttpClientMonixBackend.scala b/async-http-client-backend/monix/src/main/scala/sttp/client3/asynchttpclient/monix/AsyncHttpClientMonixBackend.scala similarity index 95% rename from async-http-client-backend/monix/src/main/scala/sttp/client/asynchttpclient/monix/AsyncHttpClientMonixBackend.scala rename to async-http-client-backend/monix/src/main/scala/sttp/client3/asynchttpclient/monix/AsyncHttpClientMonixBackend.scala index 6e3c47aab7..c052274179 100644 --- a/async-http-client-backend/monix/src/main/scala/sttp/client/asynchttpclient/monix/AsyncHttpClientMonixBackend.scala +++ b/async-http-client-backend/monix/src/main/scala/sttp/client3/asynchttpclient/monix/AsyncHttpClientMonixBackend.scala @@ -1,4 +1,4 @@ -package sttp.client.asynchttpclient.monix +package sttp.client3.asynchttpclient.monix import java.io.File import java.nio.ByteBuffer @@ -13,12 +13,12 @@ import org.asynchttpclient._ import org.reactivestreams.Publisher import sttp.capabilities.WebSockets import sttp.capabilities.monix.MonixStreams -import sttp.client.asynchttpclient.{AsyncHttpClientBackend, BodyFromAHC, BodyToAHC} -import sttp.client.impl.monix.{MonixSimpleQueue, MonixWebSockets, TaskMonadAsyncError} -import sttp.client.internal._ -import sttp.client.internal.ws.SimpleQueue -import sttp.client.testing.SttpBackendStub -import sttp.client.{FollowRedirectsBackend, SttpBackend, SttpBackendOptions} +import sttp.client3.asynchttpclient.{AsyncHttpClientBackend, BodyFromAHC, BodyToAHC} +import sttp.client3.impl.monix.{MonixSimpleQueue, MonixWebSockets, TaskMonadAsyncError} +import sttp.client3.internal._ +import sttp.client3.internal.ws.SimpleQueue +import sttp.client3.testing.SttpBackendStub +import sttp.client3.{FollowRedirectsBackend, SttpBackend, SttpBackendOptions} import sttp.monad.MonadAsyncError import sttp.ws.{WebSocket, WebSocketFrame} diff --git a/async-http-client-backend/monix/src/test/scala/sttp/client/asynchttpclient/monix/AsyncHttpClientMonixHttpTest.scala b/async-http-client-backend/monix/src/test/scala/sttp/client3/asynchttpclient/monix/AsyncHttpClientMonixHttpTest.scala similarity index 71% rename from async-http-client-backend/monix/src/test/scala/sttp/client/asynchttpclient/monix/AsyncHttpClientMonixHttpTest.scala rename to async-http-client-backend/monix/src/test/scala/sttp/client3/asynchttpclient/monix/AsyncHttpClientMonixHttpTest.scala index 3779f4e05f..6e1c4f0b23 100644 --- a/async-http-client-backend/monix/src/test/scala/sttp/client/asynchttpclient/monix/AsyncHttpClientMonixHttpTest.scala +++ b/async-http-client-backend/monix/src/test/scala/sttp/client3/asynchttpclient/monix/AsyncHttpClientMonixHttpTest.scala @@ -1,11 +1,11 @@ -package sttp.client.asynchttpclient.monix +package sttp.client3.asynchttpclient.monix import java.util.concurrent.TimeoutException import monix.eval.Task -import sttp.client._ -import sttp.client.impl.monix.convertMonixTaskToFuture -import sttp.client.testing.{CancelTest, ConvertToFuture, HttpTest} +import sttp.client3._ +import sttp.client3.impl.monix.convertMonixTaskToFuture +import sttp.client3.testing.{CancelTest, ConvertToFuture, HttpTest} import monix.execution.Scheduler.Implicits.global import scala.concurrent.duration._ @@ -17,8 +17,8 @@ class AsyncHttpClientMonixHttpTest extends HttpTest[Task] with CancelTest[Task, override def timeoutToNone[T](t: Task[T], timeoutMillis: Int): Task[Option[T]] = t.map(Some(_)) .timeout(timeoutMillis.milliseconds) - .onErrorRecover { - case _: TimeoutException => None + .onErrorRecover { case _: TimeoutException => + None } override def throwsExceptionOnUnsupportedEncoding = false diff --git a/async-http-client-backend/monix/src/test/scala/sttp/client/asynchttpclient/monix/AsyncHttpClientMonixStreamingTest.scala b/async-http-client-backend/monix/src/test/scala/sttp/client3/asynchttpclient/monix/AsyncHttpClientMonixStreamingTest.scala similarity index 74% rename from async-http-client-backend/monix/src/test/scala/sttp/client/asynchttpclient/monix/AsyncHttpClientMonixStreamingTest.scala rename to async-http-client-backend/monix/src/test/scala/sttp/client3/asynchttpclient/monix/AsyncHttpClientMonixStreamingTest.scala index 401ac721cc..500193f58b 100644 --- a/async-http-client-backend/monix/src/test/scala/sttp/client/asynchttpclient/monix/AsyncHttpClientMonixStreamingTest.scala +++ b/async-http-client-backend/monix/src/test/scala/sttp/client3/asynchttpclient/monix/AsyncHttpClientMonixStreamingTest.scala @@ -1,10 +1,10 @@ -package sttp.client.asynchttpclient.monix +package sttp.client3.asynchttpclient.monix import monix.eval.Task import monix.execution.Scheduler.Implicits.global import sttp.capabilities.monix.MonixStreams -import sttp.client.SttpBackend -import sttp.client.impl.monix.MonixStreamingTest +import sttp.client3.SttpBackend +import sttp.client3.impl.monix.MonixStreamingTest class AsyncHttpClientMonixStreamingTest extends MonixStreamingTest { override val backend: SttpBackend[Task, MonixStreams] = diff --git a/async-http-client-backend/monix/src/test/scala/sttp/client/asynchttpclient/monix/AsyncHttpClientMonixWebSocketTest.scala b/async-http-client-backend/monix/src/test/scala/sttp/client3/asynchttpclient/monix/AsyncHttpClientMonixWebSocketTest.scala similarity index 85% rename from async-http-client-backend/monix/src/test/scala/sttp/client/asynchttpclient/monix/AsyncHttpClientMonixWebSocketTest.scala rename to async-http-client-backend/monix/src/test/scala/sttp/client3/asynchttpclient/monix/AsyncHttpClientMonixWebSocketTest.scala index d8a2ed4706..c85aea901c 100644 --- a/async-http-client-backend/monix/src/test/scala/sttp/client/asynchttpclient/monix/AsyncHttpClientMonixWebSocketTest.scala +++ b/async-http-client-backend/monix/src/test/scala/sttp/client3/asynchttpclient/monix/AsyncHttpClientMonixWebSocketTest.scala @@ -1,15 +1,15 @@ -package sttp.client.asynchttpclient.monix +package sttp.client3.asynchttpclient.monix import monix.eval.Task import monix.execution.Scheduler.Implicits.global import monix.reactive.Observable import sttp.capabilities.WebSockets import sttp.capabilities.monix.MonixStreams -import sttp.client._ -import sttp.client.asynchttpclient.AsyncHttpClientWebSocketTest -import sttp.client.impl.monix.{MonixWebSockets, TaskMonadAsyncError, convertMonixTaskToFuture} +import sttp.client3._ +import sttp.client3.asynchttpclient.AsyncHttpClientWebSocketTest +import sttp.client3.impl.monix.{MonixWebSockets, TaskMonadAsyncError, convertMonixTaskToFuture} import sttp.monad.MonadError -import sttp.client.testing.ConvertToFuture +import sttp.client3.testing.ConvertToFuture import sttp.ws.WebSocketFrame import scala.concurrent.duration.FiniteDuration diff --git a/async-http-client-backend/scalaz/src/main/scala/sttp/client/asynchttpclient/scalaz/AsyncHttpClientScalazBackend.scala b/async-http-client-backend/scalaz/src/main/scala/sttp/client3/asynchttpclient/scalaz/AsyncHttpClientScalazBackend.scala similarity index 90% rename from async-http-client-backend/scalaz/src/main/scala/sttp/client/asynchttpclient/scalaz/AsyncHttpClientScalazBackend.scala rename to async-http-client-backend/scalaz/src/main/scala/sttp/client3/asynchttpclient/scalaz/AsyncHttpClientScalazBackend.scala index d369bca2e8..16a466e292 100644 --- a/async-http-client-backend/scalaz/src/main/scala/sttp/client/asynchttpclient/scalaz/AsyncHttpClientScalazBackend.scala +++ b/async-http-client-backend/scalaz/src/main/scala/sttp/client3/asynchttpclient/scalaz/AsyncHttpClientScalazBackend.scala @@ -1,4 +1,4 @@ -package sttp.client.asynchttpclient.scalaz +package sttp.client3.asynchttpclient.scalaz import java.io.File import java.nio.ByteBuffer @@ -13,12 +13,12 @@ import org.asynchttpclient.{ } import org.reactivestreams.Publisher import scalaz.concurrent.Task -import sttp.client.asynchttpclient.{AsyncHttpClientBackend, BodyFromAHC, BodyToAHC} -import sttp.client.impl.scalaz.TaskMonadAsyncError -import sttp.client.internal.NoStreams -import sttp.client.internal.ws.SimpleQueue -import sttp.client.testing.SttpBackendStub -import sttp.client.{FollowRedirectsBackend, SttpBackend, SttpBackendOptions} +import sttp.client3.asynchttpclient.{AsyncHttpClientBackend, BodyFromAHC, BodyToAHC} +import sttp.client3.impl.scalaz.TaskMonadAsyncError +import sttp.client3.internal.NoStreams +import sttp.client3.internal.ws.SimpleQueue +import sttp.client3.testing.SttpBackendStub +import sttp.client3.{FollowRedirectsBackend, SttpBackend, SttpBackendOptions} import sttp.monad.MonadAsyncError import sttp.ws.WebSocket diff --git a/async-http-client-backend/scalaz/src/test/scala/sttp/client/asynchttpclient/scalaz/AsyncHttpClientScalazHttpTest.scala b/async-http-client-backend/scalaz/src/test/scala/sttp/client3/asynchttpclient/scalaz/AsyncHttpClientScalazHttpTest.scala similarity index 64% rename from async-http-client-backend/scalaz/src/test/scala/sttp/client/asynchttpclient/scalaz/AsyncHttpClientScalazHttpTest.scala rename to async-http-client-backend/scalaz/src/test/scala/sttp/client3/asynchttpclient/scalaz/AsyncHttpClientScalazHttpTest.scala index 6eca1d72ea..e8c4eb9c9d 100644 --- a/async-http-client-backend/scalaz/src/test/scala/sttp/client/asynchttpclient/scalaz/AsyncHttpClientScalazHttpTest.scala +++ b/async-http-client-backend/scalaz/src/test/scala/sttp/client3/asynchttpclient/scalaz/AsyncHttpClientScalazHttpTest.scala @@ -1,9 +1,9 @@ -package sttp.client.asynchttpclient.scalaz +package sttp.client3.asynchttpclient.scalaz import scalaz.concurrent.Task -import sttp.client.SttpBackend -import sttp.client.impl.scalaz.convertScalazTaskToFuture -import sttp.client.testing.{ConvertToFuture, HttpTest} +import sttp.client3.SttpBackend +import sttp.client3.impl.scalaz.convertScalazTaskToFuture +import sttp.client3.testing.{ConvertToFuture, HttpTest} class AsyncHttpClientScalazHttpTest extends HttpTest[Task] { diff --git a/async-http-client-backend/src/main/scala/sttp/client/asynchttpclient/AsyncHttpClientBackend.scala b/async-http-client-backend/src/main/scala/sttp/client3/asynchttpclient/AsyncHttpClientBackend.scala similarity index 97% rename from async-http-client-backend/src/main/scala/sttp/client/asynchttpclient/AsyncHttpClientBackend.scala rename to async-http-client-backend/src/main/scala/sttp/client3/asynchttpclient/AsyncHttpClientBackend.scala index 135b6d01ee..b1d26ffe99 100644 --- a/async-http-client-backend/src/main/scala/sttp/client/asynchttpclient/AsyncHttpClientBackend.scala +++ b/async-http-client-backend/src/main/scala/sttp/client3/asynchttpclient/AsyncHttpClientBackend.scala @@ -1,4 +1,4 @@ -package sttp.client.asynchttpclient +package sttp.client3.asynchttpclient import java.nio.ByteBuffer @@ -22,12 +22,12 @@ import org.asynchttpclient.{ } import org.reactivestreams.{Publisher, Subscriber, Subscription} import sttp.capabilities.{Effect, Streams} -import sttp.client -import sttp.client.SttpBackendOptions.ProxyType.{Http, Socks} -import sttp.client.internal.ws.{SimpleQueue, WebSocketEvent} +import sttp.client3 +import sttp.client3.SttpBackendOptions.ProxyType.{Http, Socks} +import sttp.client3.internal.ws.{SimpleQueue, WebSocketEvent} import sttp.monad.syntax._ import sttp.monad.{Canceler, MonadAsyncError, MonadError} -import sttp.client.{Response, ResponseAs, SttpBackend, SttpBackendOptions, _} +import sttp.client3.{Response, ResponseAs, SttpBackend, SttpBackendOptions, _} import sttp.model._ import scala.collection.JavaConverters._ @@ -202,7 +202,7 @@ abstract class AsyncHttpClientBackend[F[_], S <: Streams[S], P]( } private def readResponseNoBody(request: Request[_, _], response: AsyncResponse): Response[Unit] = { - client.Response( + client3.Response( (), StatusCode.unsafeApply(response.getStatusCode), response.getStatusText, diff --git a/async-http-client-backend/src/main/scala/sttp/client/asynchttpclient/BodyFromAHC.scala b/async-http-client-backend/src/main/scala/sttp/client3/asynchttpclient/BodyFromAHC.scala similarity index 95% rename from async-http-client-backend/src/main/scala/sttp/client/asynchttpclient/BodyFromAHC.scala rename to async-http-client-backend/src/main/scala/sttp/client3/asynchttpclient/BodyFromAHC.scala index e098c051cf..1a4f6dfd54 100644 --- a/async-http-client-backend/src/main/scala/sttp/client/asynchttpclient/BodyFromAHC.scala +++ b/async-http-client-backend/src/main/scala/sttp/client3/asynchttpclient/BodyFromAHC.scala @@ -1,13 +1,13 @@ -package sttp.client.asynchttpclient +package sttp.client3.asynchttpclient import java.io.{ByteArrayInputStream, File} import java.nio.ByteBuffer import org.reactivestreams.Publisher import sttp.capabilities.Streams -import sttp.client.internal.{BodyFromResponseAs, FileHelpers, SttpFile, nonReplayableBody} -import sttp.client.ws.{GotAWebSocketException, NotAWebSocketException} -import sttp.client.{ +import sttp.client3.internal.{BodyFromResponseAs, FileHelpers, SttpFile, nonReplayableBody} +import sttp.client3.ws.{GotAWebSocketException, NotAWebSocketException} +import sttp.client3.{ ResponseAs, ResponseAsWebSocket, ResponseAsWebSocketStream, diff --git a/async-http-client-backend/src/main/scala/sttp/client/asynchttpclient/BodyToAHC.scala b/async-http-client-backend/src/main/scala/sttp/client3/asynchttpclient/BodyToAHC.scala similarity index 95% rename from async-http-client-backend/src/main/scala/sttp/client/asynchttpclient/BodyToAHC.scala rename to async-http-client-backend/src/main/scala/sttp/client3/asynchttpclient/BodyToAHC.scala index d5ad17b6c3..6e2696d2ef 100644 --- a/async-http-client-backend/src/main/scala/sttp/client/asynchttpclient/BodyToAHC.scala +++ b/async-http-client-backend/src/main/scala/sttp/client3/asynchttpclient/BodyToAHC.scala @@ -1,4 +1,4 @@ -package sttp.client.asynchttpclient +package sttp.client3.asynchttpclient import java.nio.charset.Charset @@ -7,7 +7,7 @@ import org.asynchttpclient.{Param, RequestBuilder} import org.asynchttpclient.request.body.multipart.{ByteArrayPart, FilePart, StringPart} import org.reactivestreams.Publisher import sttp.capabilities.Streams -import sttp.client.{ +import sttp.client3.{ BasicRequestBody, ByteArrayBody, ByteBufferBody, @@ -20,7 +20,7 @@ import sttp.client.{ StreamBody, StringBody } -import sttp.client.internal.{throwNestedMultipartNotAllowed, toByteArray} +import sttp.client3.internal.{throwNestedMultipartNotAllowed, toByteArray} import sttp.model.{HeaderNames, MediaType, Part} import scala.collection.JavaConverters._ diff --git a/async-http-client-backend/src/main/scala/sttp/client/asynchttpclient/WebSocketImpl.scala b/async-http-client-backend/src/main/scala/sttp/client3/asynchttpclient/WebSocketImpl.scala similarity index 97% rename from async-http-client-backend/src/main/scala/sttp/client/asynchttpclient/WebSocketImpl.scala rename to async-http-client-backend/src/main/scala/sttp/client3/asynchttpclient/WebSocketImpl.scala index 0d3e5163f3..6e6ffb8dbb 100644 --- a/async-http-client-backend/src/main/scala/sttp/client/asynchttpclient/WebSocketImpl.scala +++ b/async-http-client-backend/src/main/scala/sttp/client3/asynchttpclient/WebSocketImpl.scala @@ -1,10 +1,10 @@ -package sttp.client.asynchttpclient +package sttp.client3.asynchttpclient import java.util.concurrent.atomic.AtomicBoolean import io.netty.util.concurrent.{Future, FutureListener} import org.asynchttpclient.ws.{WebSocket => AHCWebSocket, WebSocketListener => AHCWebSocketListener} -import sttp.client.internal.ws.{SimpleQueue, WebSocketEvent} +import sttp.client3.internal.ws.{SimpleQueue, WebSocketEvent} import sttp.model.{Header, Headers} import sttp.monad.syntax._ import sttp.monad.{Canceler, MonadAsyncError} diff --git a/async-http-client-backend/src/main/scala/sttp/client/asynchttpclient/reactive.scala b/async-http-client-backend/src/main/scala/sttp/client3/asynchttpclient/reactive.scala similarity index 98% rename from async-http-client-backend/src/main/scala/sttp/client/asynchttpclient/reactive.scala rename to async-http-client-backend/src/main/scala/sttp/client3/asynchttpclient/reactive.scala index 6cdcb08736..d5d3420342 100644 --- a/async-http-client-backend/src/main/scala/sttp/client/asynchttpclient/reactive.scala +++ b/async-http-client-backend/src/main/scala/sttp/client3/asynchttpclient/reactive.scala @@ -1,4 +1,4 @@ -package sttp.client.asynchttpclient +package sttp.client3.asynchttpclient import java.nio.ByteBuffer import java.util.concurrent.ConcurrentLinkedQueue diff --git a/async-http-client-backend/src/test/scala/sttp/client/asynchttpclient/AsyncHttpClientWebSocketTest.scala b/async-http-client-backend/src/test/scala/sttp/client3/asynchttpclient/AsyncHttpClientWebSocketTest.scala similarity index 68% rename from async-http-client-backend/src/test/scala/sttp/client/asynchttpclient/AsyncHttpClientWebSocketTest.scala rename to async-http-client-backend/src/test/scala/sttp/client3/asynchttpclient/AsyncHttpClientWebSocketTest.scala index bc7abe6066..c1064a60c6 100644 --- a/async-http-client-backend/src/test/scala/sttp/client/asynchttpclient/AsyncHttpClientWebSocketTest.scala +++ b/async-http-client-backend/src/test/scala/sttp/client3/asynchttpclient/AsyncHttpClientWebSocketTest.scala @@ -1,6 +1,6 @@ -package sttp.client.asynchttpclient +package sttp.client3.asynchttpclient -import sttp.client.testing.websocket.{WebSocketBufferOverflowTest, WebSocketStreamingTest, WebSocketTest} +import sttp.client3.testing.websocket.{WebSocketBufferOverflowTest, WebSocketStreamingTest, WebSocketTest} abstract class AsyncHttpClientWebSocketTest[F[_], S] extends WebSocketTest[F] diff --git a/async-http-client-backend/zio/src/main/scala/sttp/client/asynchttpclient/zio/AsyncHttpClientZioBackend.scala b/async-http-client-backend/zio/src/main/scala/sttp/client3/asynchttpclient/zio/AsyncHttpClientZioBackend.scala similarity index 96% rename from async-http-client-backend/zio/src/main/scala/sttp/client/asynchttpclient/zio/AsyncHttpClientZioBackend.scala rename to async-http-client-backend/zio/src/main/scala/sttp/client3/asynchttpclient/zio/AsyncHttpClientZioBackend.scala index 863f3a2085..fb2d7fa450 100644 --- a/async-http-client-backend/zio/src/main/scala/sttp/client/asynchttpclient/zio/AsyncHttpClientZioBackend.scala +++ b/async-http-client-backend/zio/src/main/scala/sttp/client3/asynchttpclient/zio/AsyncHttpClientZioBackend.scala @@ -1,4 +1,4 @@ -package sttp.client.asynchttpclient.zio +package sttp.client3.asynchttpclient.zio import java.io.{BufferedInputStream, File, FileInputStream, FileOutputStream} import java.nio.ByteBuffer @@ -21,12 +21,12 @@ import org.asynchttpclient.{ import org.reactivestreams.Publisher import sttp.capabilities.WebSockets import sttp.capabilities.zio.ZioStreams -import sttp.client.asynchttpclient.{AsyncHttpClientBackend, BodyFromAHC, BodyToAHC} -import sttp.client.impl.zio.{RIOMonadAsyncError, ZioSimpleQueue, ZioWebSockets} -import sttp.client.internal._ -import sttp.client.internal.ws.SimpleQueue -import sttp.client.testing.SttpBackendStub -import sttp.client.{FollowRedirectsBackend, SttpBackend, SttpBackendOptions} +import sttp.client3.asynchttpclient.{AsyncHttpClientBackend, BodyFromAHC, BodyToAHC} +import sttp.client3.impl.zio.{RIOMonadAsyncError, ZioSimpleQueue, ZioWebSockets} +import sttp.client3.internal._ +import sttp.client3.internal.ws.SimpleQueue +import sttp.client3.testing.SttpBackendStub +import sttp.client3.{FollowRedirectsBackend, SttpBackend, SttpBackendOptions} import sttp.monad.MonadAsyncError import sttp.ws.{WebSocket, WebSocketFrame} diff --git a/async-http-client-backend/zio/src/main/scala/sttp/client/asynchttpclient/zio/package.scala b/async-http-client-backend/zio/src/main/scala/sttp/client3/asynchttpclient/zio/package.scala similarity index 95% rename from async-http-client-backend/zio/src/main/scala/sttp/client/asynchttpclient/zio/package.scala rename to async-http-client-backend/zio/src/main/scala/sttp/client3/asynchttpclient/zio/package.scala index d9cdeb23c6..7a2adc72ca 100644 --- a/async-http-client-backend/zio/src/main/scala/sttp/client/asynchttpclient/zio/package.scala +++ b/async-http-client-backend/zio/src/main/scala/sttp/client3/asynchttpclient/zio/package.scala @@ -1,10 +1,10 @@ -package sttp.client.asynchttpclient +package sttp.client3.asynchttpclient -import sttp.client._ +import sttp.client3._ import _root_.zio._ import sttp.capabilities.zio.ZioStreams import sttp.capabilities.{Effect, WebSockets} -import sttp.client.impl.zio.{ExtendEnv, SttpClientStubbingBase} +import sttp.client3.impl.zio.{ExtendEnv, SttpClientStubbingBase} package object zio { diff --git a/async-http-client-backend/zio/src/test/scala/sttp/client/asynchttpclient/zio/AsyncHttpClientZioHttpTest.scala b/async-http-client-backend/zio/src/test/scala/sttp/client3/asynchttpclient/zio/AsyncHttpClientZioHttpTest.scala similarity index 76% rename from async-http-client-backend/zio/src/test/scala/sttp/client/asynchttpclient/zio/AsyncHttpClientZioHttpTest.scala rename to async-http-client-backend/zio/src/test/scala/sttp/client3/asynchttpclient/zio/AsyncHttpClientZioHttpTest.scala index 60f91262a6..7407374c6a 100644 --- a/async-http-client-backend/zio/src/test/scala/sttp/client/asynchttpclient/zio/AsyncHttpClientZioHttpTest.scala +++ b/async-http-client-backend/zio/src/test/scala/sttp/client3/asynchttpclient/zio/AsyncHttpClientZioHttpTest.scala @@ -1,8 +1,8 @@ -package sttp.client.asynchttpclient.zio +package sttp.client3.asynchttpclient.zio -import sttp.client._ -import sttp.client.impl.zio.ZioTestBase -import sttp.client.testing.{CancelTest, ConvertToFuture, HttpTest} +import sttp.client3._ +import sttp.client3.impl.zio.ZioTestBase +import sttp.client3.testing.{CancelTest, ConvertToFuture, HttpTest} import zio.Task import zio.clock.Clock import zio.duration._ diff --git a/async-http-client-backend/zio/src/test/scala/sttp/client/asynchttpclient/zio/AsyncHttpClientZioStreamingTest.scala b/async-http-client-backend/zio/src/test/scala/sttp/client3/asynchttpclient/zio/AsyncHttpClientZioStreamingTest.scala similarity index 76% rename from async-http-client-backend/zio/src/test/scala/sttp/client/asynchttpclient/zio/AsyncHttpClientZioStreamingTest.scala rename to async-http-client-backend/zio/src/test/scala/sttp/client3/asynchttpclient/zio/AsyncHttpClientZioStreamingTest.scala index daa74d183e..7488115ea6 100644 --- a/async-http-client-backend/zio/src/test/scala/sttp/client/asynchttpclient/zio/AsyncHttpClientZioStreamingTest.scala +++ b/async-http-client-backend/zio/src/test/scala/sttp/client3/asynchttpclient/zio/AsyncHttpClientZioStreamingTest.scala @@ -1,11 +1,11 @@ -package sttp.client.asynchttpclient.zio +package sttp.client3.asynchttpclient.zio import sttp.capabilities.zio.ZioStreams -import sttp.client.SttpBackend -import sttp.client.impl.zio.ZioTestBase -import sttp.client.internal._ -import sttp.client.testing.ConvertToFuture -import sttp.client.testing.streaming.StreamingTest +import sttp.client3.SttpBackend +import sttp.client3.impl.zio.ZioTestBase +import sttp.client3.internal._ +import sttp.client3.testing.ConvertToFuture +import sttp.client3.testing.streaming.StreamingTest import zio.{Chunk, Task} import zio.stream.Stream diff --git a/async-http-client-backend/zio/src/test/scala/sttp/client/asynchttpclient/zio/AsyncHttpClientZioWebSocketTest.scala b/async-http-client-backend/zio/src/test/scala/sttp/client3/asynchttpclient/zio/AsyncHttpClientZioWebSocketTest.scala similarity index 86% rename from async-http-client-backend/zio/src/test/scala/sttp/client/asynchttpclient/zio/AsyncHttpClientZioWebSocketTest.scala rename to async-http-client-backend/zio/src/test/scala/sttp/client3/asynchttpclient/zio/AsyncHttpClientZioWebSocketTest.scala index bd06fb35e6..a2d3412cb3 100644 --- a/async-http-client-backend/zio/src/test/scala/sttp/client/asynchttpclient/zio/AsyncHttpClientZioWebSocketTest.scala +++ b/async-http-client-backend/zio/src/test/scala/sttp/client3/asynchttpclient/zio/AsyncHttpClientZioWebSocketTest.scala @@ -1,11 +1,11 @@ -package sttp.client.asynchttpclient.zio +package sttp.client3.asynchttpclient.zio import sttp.capabilities.WebSockets import sttp.capabilities.zio.ZioStreams -import sttp.client._ -import sttp.client.asynchttpclient.AsyncHttpClientWebSocketTest -import sttp.client.impl.zio.{RIOMonadAsyncError, ZioTestBase, ZioWebSockets} -import sttp.client.testing.ConvertToFuture +import sttp.client3._ +import sttp.client3.asynchttpclient.AsyncHttpClientWebSocketTest +import sttp.client3.impl.zio.{RIOMonadAsyncError, ZioTestBase, ZioWebSockets} +import sttp.client3.testing.ConvertToFuture import sttp.monad.MonadError import sttp.ws.WebSocketFrame import zio.clock.Clock diff --git a/async-http-client-backend/zio/src/test/scala/sttp/client/asynchttpclient/zio/SttpBackendStubZioTests.scala b/async-http-client-backend/zio/src/test/scala/sttp/client3/asynchttpclient/zio/SttpBackendStubZioTests.scala similarity index 93% rename from async-http-client-backend/zio/src/test/scala/sttp/client/asynchttpclient/zio/SttpBackendStubZioTests.scala rename to async-http-client-backend/zio/src/test/scala/sttp/client3/asynchttpclient/zio/SttpBackendStubZioTests.scala index e2466a9c84..7332df7866 100644 --- a/async-http-client-backend/zio/src/test/scala/sttp/client/asynchttpclient/zio/SttpBackendStubZioTests.scala +++ b/async-http-client-backend/zio/src/test/scala/sttp/client3/asynchttpclient/zio/SttpBackendStubZioTests.scala @@ -1,11 +1,11 @@ -package sttp.client.asynchttpclient.zio +package sttp.client3.asynchttpclient.zio import org.scalatest.concurrent.ScalaFutures import org.scalatest.flatspec.AnyFlatSpec import org.scalatest.matchers.should.Matchers -import sttp.client._ -import sttp.client.impl.zio._ -import sttp.client.testing.SttpBackendStub +import sttp.client3._ +import sttp.client3.impl.zio._ +import sttp.client3.testing.SttpBackendStub import sttp.model.Method import zio._ import zio.stream.ZStream diff --git a/build.sbt b/build.sbt index ce2896a905..63566b7bc9 100644 --- a/build.sbt +++ b/build.sbt @@ -14,7 +14,7 @@ lazy val testServerPort = settingKey[Int]("Port to run the http test server on") lazy val startTestServer = taskKey[Unit]("Start a http server used by tests") val commonSettings = commonSmlBuildSettings ++ ossPublishSettings ++ Seq( - organization := "com.softwaremill.sttp.client", + organization := "com.softwaremill.sttp.client3", scmInfo := Some(ScmInfo(url("https://github.com/softwaremill/sttp"), "scm:git@github.com:softwaremill/sttp.git")), // needed on sbt 1.3, but (for some unknown reason) only on 2.11.x closeClassLoaders := !scalaVersion.value.startsWith("2.11."), @@ -296,7 +296,7 @@ lazy val testServer = (projectMatrix in file("testing/server")) akkaStreams ), // the test server needs to be started before running any backend tests - mainClass in reStart := Some("sttp.client.testing.server.HttpServer"), + mainClass in reStart := Some("sttp.client3.testing.server.HttpServer"), reStartArgs in reStart := Seq(s"${(testServerPort in Test).value}"), fullClasspath in reStart := (fullClasspath in Test).value, testServerPort := 51823, diff --git a/core/src/main/scala/sttp/client/DigestAuthenticationBackend.scala b/core/src/main/scala/sttp/client3/DigestAuthenticationBackend.scala similarity index 84% rename from core/src/main/scala/sttp/client/DigestAuthenticationBackend.scala rename to core/src/main/scala/sttp/client3/DigestAuthenticationBackend.scala index e81c7265c4..f8ad36ffc7 100644 --- a/core/src/main/scala/sttp/client/DigestAuthenticationBackend.scala +++ b/core/src/main/scala/sttp/client3/DigestAuthenticationBackend.scala @@ -1,9 +1,9 @@ -package sttp.client +package sttp.client3 import sttp.capabilities.Effect -import sttp.client.DigestAuthenticationBackend._ -import sttp.client.internal.DigestAuthenticator -import sttp.client.internal.DigestAuthenticator.DigestAuthData +import sttp.client3.DigestAuthenticationBackend._ +import sttp.client3.internal.DigestAuthenticator +import sttp.client3.internal.DigestAuthenticator.DigestAuthData import sttp.monad.MonadError import sttp.monad.syntax._ import sttp.model.Header @@ -51,6 +51,6 @@ class DigestAuthenticationBackend[F[_], P]( } object DigestAuthenticationBackend { - private[client] val DigestAuthTag = "__sttp_DigestAuth" - private[client] val ProxyDigestAuthTag = "__sttp_ProxyDigestAuth" + private[client3] val DigestAuthTag = "__sttp_DigestAuth" + private[client3] val ProxyDigestAuthTag = "__sttp_ProxyDigestAuth" } diff --git a/core/src/main/scala/sttp/client/EitherBackend.scala b/core/src/main/scala/sttp/client3/EitherBackend.scala similarity index 95% rename from core/src/main/scala/sttp/client/EitherBackend.scala rename to core/src/main/scala/sttp/client3/EitherBackend.scala index aedc7089c6..7999066a06 100644 --- a/core/src/main/scala/sttp/client/EitherBackend.scala +++ b/core/src/main/scala/sttp/client3/EitherBackend.scala @@ -1,7 +1,7 @@ -package sttp.client +package sttp.client3 import sttp.capabilities.Effect -import sttp.client.monad.{FunctionK, MapEffect} +import sttp.client3.monad.{FunctionK, MapEffect} import sttp.monad.{EitherMonad, MonadError} import scala.util.control.NonFatal diff --git a/core/src/main/scala/sttp/client/FollowRedirectsBackend.scala b/core/src/main/scala/sttp/client3/FollowRedirectsBackend.scala similarity index 96% rename from core/src/main/scala/sttp/client/FollowRedirectsBackend.scala rename to core/src/main/scala/sttp/client3/FollowRedirectsBackend.scala index 86a64d6a4d..cbbdae5acd 100644 --- a/core/src/main/scala/sttp/client/FollowRedirectsBackend.scala +++ b/core/src/main/scala/sttp/client3/FollowRedirectsBackend.scala @@ -1,4 +1,4 @@ -package sttp.client +package sttp.client3 import java.net.URI @@ -98,9 +98,9 @@ class FollowRedirectsBackend[F[_], P]( } object FollowRedirectsBackend { - private[client] val MaxRedirects = 32 + private[client3] val MaxRedirects = 32 - private[client] def isRelative(uri: String): Boolean = uri.trim.startsWith("/") + private[client3] def isRelative(uri: String): Boolean = uri.trim.startsWith("/") } case class TooManyRedirectsException(uri: Uri, redirects: Int) extends Exception diff --git a/core/src/main/scala/sttp/client/RequestBody.scala b/core/src/main/scala/sttp/client3/RequestBody.scala similarity index 94% rename from core/src/main/scala/sttp/client/RequestBody.scala rename to core/src/main/scala/sttp/client3/RequestBody.scala index 8f4a1c99ad..ef8e003ce4 100644 --- a/core/src/main/scala/sttp/client/RequestBody.scala +++ b/core/src/main/scala/sttp/client3/RequestBody.scala @@ -1,11 +1,11 @@ -package sttp.client +package sttp.client3 import java.io.InputStream import java.nio.ByteBuffer import sttp.capabilities.Streams import sttp.model._ -import sttp.client.internal.SttpFile +import sttp.client3.internal.SttpFile import sttp.model.internal.UriCompatibility import scala.collection.immutable.Seq @@ -74,7 +74,7 @@ case class MultipartBody[R](parts: Seq[Part[RequestBody[R]]]) extends RequestBod } object RequestBody { - private[client] def paramsToStringBody(fs: Seq[(String, String)], encoding: String): StringBody = { + private[client3] def paramsToStringBody(fs: Seq[(String, String)], encoding: String): StringBody = { val b = fs .map { case (key, value) => UriCompatibility.encodeQuery(key, encoding) + "=" + diff --git a/core/src/main/scala/sttp/client/RequestMetadata.scala b/core/src/main/scala/sttp/client3/RequestMetadata.scala similarity index 80% rename from core/src/main/scala/sttp/client/RequestMetadata.scala rename to core/src/main/scala/sttp/client3/RequestMetadata.scala index caabadf471..12c4243198 100644 --- a/core/src/main/scala/sttp/client/RequestMetadata.scala +++ b/core/src/main/scala/sttp/client3/RequestMetadata.scala @@ -1,4 +1,4 @@ -package sttp.client +package sttp.client3 import sttp.model.{HasHeaders, Header, Method, Uri} @@ -14,7 +14,7 @@ trait RequestMetadata extends HasHeaders { object RequestMetadata { /** - * Mainly useful in tests using [[sttp.client.testing.SttpBackendStub]], when creating stub responses. + * Mainly useful in tests using [[sttp.client3.testing.SttpBackendStub]], when creating stub responses. */ val ExampleGet: RequestMetadata = new RequestMetadata { override def method: Method = Method.GET diff --git a/core/src/main/scala/sttp/client/RequestT.scala b/core/src/main/scala/sttp/client3/RequestT.scala similarity index 97% rename from core/src/main/scala/sttp/client/RequestT.scala rename to core/src/main/scala/sttp/client3/RequestT.scala index be5580f8b9..7e4a084ca8 100644 --- a/core/src/main/scala/sttp/client/RequestT.scala +++ b/core/src/main/scala/sttp/client3/RequestT.scala @@ -1,13 +1,13 @@ -package sttp.client +package sttp.client3 import java.io.InputStream import java.nio.ByteBuffer import java.util.Base64 import sttp.capabilities.{Effect, Streams} -import sttp.client.internal.DigestAuthenticator.DigestAuthData -import sttp.client.internal._ -import sttp.client.internal.{SttpFile, ToCurlConverter} +import sttp.client3.internal.DigestAuthenticator.DigestAuthData +import sttp.client3.internal._ +import sttp.client3.internal.{SttpFile, ToCurlConverter} import sttp.model._ import scala.collection.immutable.Seq @@ -170,7 +170,7 @@ case class RequestT[U[_], T, -R]( * If content length is not yet specified, will be set to the length * of the given file. */ - private[client] def body(f: SttpFile): RequestT[U, T, R] = + private[client3] def body(f: SttpFile): RequestT[U, T, R] = withBody(FileBody(f)).setContentLengthIfMissing(f.size) /** @@ -349,7 +349,7 @@ case class RequestT[U[_], T, -R]( private def setContentTypeIfMissing(mt: MediaType): RequestT[U, T, R] = if (hasContentType) this else contentType(mt) - private[client] def withBody[R2](body: RequestBody[R2]): RequestT[U, T, R with R2] = { + private[client3] def withBody[R2](body: RequestBody[R2]): RequestT[U, T, R with R2] = { val defaultCt = body match { case StringBody(_, encoding, ct) => ct.copy(charset = Some(encoding)) @@ -372,7 +372,7 @@ case class RequestT[U[_], T, -R]( .copy(body = b) } - private[client] def onlyMetadata(implicit isIdInRequest: IsIdInRequest[U]): RequestMetadata = { + private[client3] def onlyMetadata(implicit isIdInRequest: IsIdInRequest[U]): RequestMetadata = { val r = asRequest val m = r.method val u = r.uri diff --git a/core/src/main/scala/sttp/client/Response.scala b/core/src/main/scala/sttp/client3/Response.scala similarity index 86% rename from core/src/main/scala/sttp/client/Response.scala rename to core/src/main/scala/sttp/client3/Response.scala index 16765747c9..a8d6893bed 100644 --- a/core/src/main/scala/sttp/client/Response.scala +++ b/core/src/main/scala/sttp/client3/Response.scala @@ -1,4 +1,4 @@ -package sttp.client +package sttp.client3 import sttp.model.{Header, HeaderNames, StatusCode} @@ -30,28 +30,28 @@ object Response { /** * Convenience method to create a Response instance, mainly useful in tests using - * [[sttp.client.testing.SttpBackendStub]] and partial matchers. + * [[sttp.client3.testing.SttpBackendStub]] and partial matchers. */ def apply[T](body: T, code: StatusCode): Response[T] = Response(body, code, "", Nil, Nil, RequestMetadata.ExampleGet) /** * Convenience method to create a Response instance, mainly useful in tests using - * [[sttp.client.testing.SttpBackendStub]] and partial matchers. + * [[sttp.client3.testing.SttpBackendStub]] and partial matchers. */ def apply[T](body: T, code: StatusCode, statusText: String): Response[T] = Response(body, code, statusText, Nil, Nil, RequestMetadata.ExampleGet) /** * Convenience method to create a Response instance, mainly useful in tests using - * [[sttp.client.testing.SttpBackendStub]] and partial matchers. + * [[sttp.client3.testing.SttpBackendStub]] and partial matchers. */ def apply[T](body: T, code: StatusCode, statusText: String, headers: Seq[Header]): Response[T] = Response(body, code, statusText, headers, Nil, RequestMetadata.ExampleGet) /** * Convenience method to create a Response instance, mainly useful in tests using - * [[sttp.client.testing.SttpBackendStub]] and partial matchers. + * [[sttp.client3.testing.SttpBackendStub]] and partial matchers. */ def ok[T](body: T): Response[T] = apply(body, StatusCode.Ok, "OK") } diff --git a/core/src/main/scala/sttp/client/ResponseAs.scala b/core/src/main/scala/sttp/client3/ResponseAs.scala similarity index 98% rename from core/src/main/scala/sttp/client/ResponseAs.scala rename to core/src/main/scala/sttp/client3/ResponseAs.scala index 3d38e69d2d..4b87bfa81b 100644 --- a/core/src/main/scala/sttp/client/ResponseAs.scala +++ b/core/src/main/scala/sttp/client3/ResponseAs.scala @@ -1,7 +1,7 @@ -package sttp.client +package sttp.client3 import sttp.capabilities.{Effect, Streams, WebSockets} -import sttp.client.internal._ +import sttp.client3.internal._ import sttp.model.StatusCode import sttp.model.internal.Rfc3986 import sttp.ws.{WebSocket, WebSocketFrame} @@ -17,7 +17,7 @@ import scala.util.{Failure, Success, Try} * headers and status code. Responses can also be handled depending on the response metadata. Finally, two response * body descriptions can be combined (with some restrictions). * - * A number of `as[Type]` helper methods are available as part of [[SttpApi]] and when importing `sttp.client._`. + * A number of `as[Type]` helper methods are available as part of [[SttpApi]] and when importing `sttp.client3._`. * * @tparam T Target type as which the response will be read. * @tparam R The backend capabilities required by the response description. This might be `Any` (no @@ -135,7 +135,7 @@ object ResponseAs { } } - private[client] def parseParams(s: String, charset: String): Seq[(String, String)] = { + private[client3] def parseParams(s: String, charset: String): Seq[(String, String)] = { s.split("&") .toList .flatMap(kv => diff --git a/core/src/main/scala/sttp/client/ResponseMetadata.scala b/core/src/main/scala/sttp/client3/ResponseMetadata.scala similarity index 97% rename from core/src/main/scala/sttp/client/ResponseMetadata.scala rename to core/src/main/scala/sttp/client3/ResponseMetadata.scala index 122bc45090..2dbaf0c60d 100644 --- a/core/src/main/scala/sttp/client/ResponseMetadata.scala +++ b/core/src/main/scala/sttp/client3/ResponseMetadata.scala @@ -1,4 +1,4 @@ -package sttp.client +package sttp.client3 import sttp.model._ import sttp.model.{Header, StatusCode} diff --git a/core/src/main/scala/sttp/client/RetryWhen.scala b/core/src/main/scala/sttp/client3/RetryWhen.scala similarity index 97% rename from core/src/main/scala/sttp/client/RetryWhen.scala rename to core/src/main/scala/sttp/client3/RetryWhen.scala index 09b22ba0a6..d6ac07332b 100644 --- a/core/src/main/scala/sttp/client/RetryWhen.scala +++ b/core/src/main/scala/sttp/client3/RetryWhen.scala @@ -1,4 +1,4 @@ -package sttp.client +package sttp.client3 import sttp.model.Method diff --git a/core/src/main/scala/sttp/client/SttpApi.scala b/core/src/main/scala/sttp/client3/SttpApi.scala similarity index 97% rename from core/src/main/scala/sttp/client/SttpApi.scala rename to core/src/main/scala/sttp/client3/SttpApi.scala index 94ce1b843f..3358c3543c 100644 --- a/core/src/main/scala/sttp/client/SttpApi.scala +++ b/core/src/main/scala/sttp/client3/SttpApi.scala @@ -1,12 +1,12 @@ -package sttp.client +package sttp.client3 import java.io.InputStream import java.nio.ByteBuffer import sttp.capabilities.{Effect, Streams, WebSockets} -import sttp.client.internal._ +import sttp.client3.internal._ import sttp.model._ -import sttp.client.internal.SttpFile +import sttp.client3.internal.SttpFile import sttp.ws.{WebSocket, WebSocketFrame} import scala.collection.immutable.Seq @@ -125,7 +125,7 @@ trait SttpApi extends SttpExtensions with UriInterpolator { def asStreamAlwaysUnsafe[S](s: Streams[S]): ResponseAs[s.BinaryStream, S] = ResponseAsStreamUnsafe(s) - private[client] def asSttpFile(file: SttpFile): ResponseAs[SttpFile, Any] = + private[client3] def asSttpFile(file: SttpFile): ResponseAs[SttpFile, Any] = ResponseAsFile(file) def asWebSocket[F[_], T](f: WebSocket[F] => F[T]): ResponseAs[Either[String, T], Effect[F] with WebSockets] = @@ -231,7 +231,7 @@ trait SttpApi extends SttpExtensions with UriInterpolator { * * File name will be set to the name of the file. */ - private[client] def multipartSttpFile(name: String, file: SttpFile): Part[BasicRequestBody] = + private[client3] def multipartSttpFile(name: String, file: SttpFile): Part[BasicRequestBody] = Part(name, FileBody(file), fileName = Some(file.name), contentType = Some(MediaType.ApplicationOctetStream)) /** diff --git a/core/src/main/scala/sttp/client/SttpBackend.scala b/core/src/main/scala/sttp/client3/SttpBackend.scala similarity index 98% rename from core/src/main/scala/sttp/client/SttpBackend.scala rename to core/src/main/scala/sttp/client3/SttpBackend.scala index ffa607cee6..807fbd9a2a 100644 --- a/core/src/main/scala/sttp/client/SttpBackend.scala +++ b/core/src/main/scala/sttp/client3/SttpBackend.scala @@ -1,4 +1,4 @@ -package sttp.client +package sttp.client3 import sttp.capabilities._ import sttp.monad.MonadError diff --git a/core/src/main/scala/sttp/client/SttpBackendOptions.scala b/core/src/main/scala/sttp/client3/SttpBackendOptions.scala similarity index 98% rename from core/src/main/scala/sttp/client/SttpBackendOptions.scala rename to core/src/main/scala/sttp/client3/SttpBackendOptions.scala index 5ad3fe1c44..6e486d0c06 100644 --- a/core/src/main/scala/sttp/client/SttpBackendOptions.scala +++ b/core/src/main/scala/sttp/client3/SttpBackendOptions.scala @@ -1,10 +1,10 @@ -package sttp.client +package sttp.client3 import java.io.IOException import java.net.{InetSocketAddress, SocketAddress} import java.{net, util} -import sttp.client.SttpBackendOptions._ +import sttp.client3.SttpBackendOptions._ import scala.concurrent.duration._ import scala.util.Try diff --git a/core/src/main/scala/sttp/client/SttpClientException.scala b/core/src/main/scala/sttp/client3/SttpClientException.scala similarity index 97% rename from core/src/main/scala/sttp/client/SttpClientException.scala rename to core/src/main/scala/sttp/client3/SttpClientException.scala index 1472bd8776..fd7c31f6f9 100644 --- a/core/src/main/scala/sttp/client/SttpClientException.scala +++ b/core/src/main/scala/sttp/client3/SttpClientException.scala @@ -1,6 +1,6 @@ -package sttp.client +package sttp.client3 -import sttp.client.ws.{GotAWebSocketException, NotAWebSocketException} +import sttp.client3.ws.{GotAWebSocketException, NotAWebSocketException} import sttp.monad.MonadError import scala.annotation.tailrec diff --git a/core/src/main/scala/sttp/client/TryBackend.scala b/core/src/main/scala/sttp/client3/TryBackend.scala similarity index 94% rename from core/src/main/scala/sttp/client/TryBackend.scala rename to core/src/main/scala/sttp/client3/TryBackend.scala index fc93f22223..98a63c10d8 100644 --- a/core/src/main/scala/sttp/client/TryBackend.scala +++ b/core/src/main/scala/sttp/client3/TryBackend.scala @@ -1,7 +1,7 @@ -package sttp.client +package sttp.client3 import sttp.capabilities.Effect -import sttp.client.monad.{FunctionK, MapEffect} +import sttp.client3.monad.{FunctionK, MapEffect} import sttp.monad.{MonadError, TryMonad} import scala.util.Try diff --git a/core/src/main/scala/sttp/client/internal/BodyFromResponseAs.scala b/core/src/main/scala/sttp/client3/internal/BodyFromResponseAs.scala similarity index 96% rename from core/src/main/scala/sttp/client/internal/BodyFromResponseAs.scala rename to core/src/main/scala/sttp/client3/internal/BodyFromResponseAs.scala index ddbf7c5451..2581d71cf3 100644 --- a/core/src/main/scala/sttp/client/internal/BodyFromResponseAs.scala +++ b/core/src/main/scala/sttp/client3/internal/BodyFromResponseAs.scala @@ -1,7 +1,7 @@ -package sttp.client.internal +package sttp.client3.internal -import sttp.client._ -import sttp.client.ws.{GotAWebSocketException, NotAWebSocketException} +import sttp.client3._ +import sttp.client3.ws.{GotAWebSocketException, NotAWebSocketException} import sttp.monad.MonadError import sttp.monad.syntax._ diff --git a/core/src/main/scala/sttp/client/internal/DigestAuthenticator.scala b/core/src/main/scala/sttp/client3/internal/DigestAuthenticator.scala similarity index 97% rename from core/src/main/scala/sttp/client/internal/DigestAuthenticator.scala rename to core/src/main/scala/sttp/client3/internal/DigestAuthenticator.scala index b40dc4e9b9..c6840243e5 100644 --- a/core/src/main/scala/sttp/client/internal/DigestAuthenticator.scala +++ b/core/src/main/scala/sttp/client3/internal/DigestAuthenticator.scala @@ -1,14 +1,14 @@ -package sttp.client.internal +package sttp.client3.internal import java.nio.charset.Charset -import sttp.client._ -import sttp.client.internal.DigestAuthenticator._ +import sttp.client3._ +import sttp.client3.internal.DigestAuthenticator._ import sttp.model.{Header, HeaderNames, StatusCode} import scala.util.Random -private[client] class DigestAuthenticator private ( +private[client3] class DigestAuthenticator private ( digestAuthData: DigestAuthData, requestHeaderName: String, responseHeaderName: String, @@ -209,7 +209,7 @@ private[client] class DigestAuthenticator private ( } } -private[client] object DigestAuthenticator { +private[client3] object DigestAuthenticator { val QualityOfProtectionAuth = "auth" val QualityOfProtectionAuthInt = "auth-int" case class DigestAuthData(username: String, password: String) diff --git a/core/src/main/scala/sttp/client/internal/NoStreams.scala b/core/src/main/scala/sttp/client3/internal/NoStreams.scala similarity index 86% rename from core/src/main/scala/sttp/client/internal/NoStreams.scala rename to core/src/main/scala/sttp/client3/internal/NoStreams.scala index 0c10ee87ed..8bce5aef8a 100644 --- a/core/src/main/scala/sttp/client/internal/NoStreams.scala +++ b/core/src/main/scala/sttp/client3/internal/NoStreams.scala @@ -1,4 +1,4 @@ -package sttp.client.internal +package sttp.client3.internal import sttp.capabilities.Streams diff --git a/core/src/main/scala/sttp/client/internal/SttpFile.scala b/core/src/main/scala/sttp/client3/internal/SttpFile.scala similarity index 94% rename from core/src/main/scala/sttp/client/internal/SttpFile.scala rename to core/src/main/scala/sttp/client3/internal/SttpFile.scala index dec0d0e396..c56b28e18f 100644 --- a/core/src/main/scala/sttp/client/internal/SttpFile.scala +++ b/core/src/main/scala/sttp/client3/internal/SttpFile.scala @@ -1,4 +1,4 @@ -package sttp.client.internal +package sttp.client3.internal /** * A platform agnostic file abstraction. diff --git a/core/src/main/scala/sttp/client/internal/ToCurlConverter.scala b/core/src/main/scala/sttp/client3/internal/ToCurlConverter.scala similarity index 96% rename from core/src/main/scala/sttp/client/internal/ToCurlConverter.scala rename to core/src/main/scala/sttp/client3/internal/ToCurlConverter.scala index bbf7eec0d2..dafc3c90d1 100644 --- a/core/src/main/scala/sttp/client/internal/ToCurlConverter.scala +++ b/core/src/main/scala/sttp/client3/internal/ToCurlConverter.scala @@ -1,8 +1,8 @@ -package sttp.client.internal +package sttp.client3.internal -import sttp.client._ +import sttp.client3._ import sttp.model._ -import sttp.client.NoBody +import sttp.client3.NoBody import sttp.model.MediaType class ToCurlConverter[R <: RequestT[Identity, _, _]] { diff --git a/core/src/main/scala/sttp/client/internal/WwwAuthHeaderParser.scala b/core/src/main/scala/sttp/client3/internal/WwwAuthHeaderParser.scala similarity index 99% rename from core/src/main/scala/sttp/client/internal/WwwAuthHeaderParser.scala rename to core/src/main/scala/sttp/client3/internal/WwwAuthHeaderParser.scala index fe1d77af87..13d94a8ebf 100644 --- a/core/src/main/scala/sttp/client/internal/WwwAuthHeaderParser.scala +++ b/core/src/main/scala/sttp/client3/internal/WwwAuthHeaderParser.scala @@ -1,4 +1,4 @@ -package sttp.client.internal +package sttp.client3.internal object WwwAuthHeaderParser { def parse(text: String): WwwAuthHeaderValue = { diff --git a/core/src/main/scala/sttp/client/internal/package.scala b/core/src/main/scala/sttp/client3/internal/package.scala similarity index 60% rename from core/src/main/scala/sttp/client/internal/package.scala rename to core/src/main/scala/sttp/client3/internal/package.scala index d1e6d9d2c8..4c5fdcca2f 100644 --- a/core/src/main/scala/sttp/client/internal/package.scala +++ b/core/src/main/scala/sttp/client3/internal/package.scala @@ -1,4 +1,4 @@ -package sttp.client +package sttp.client3 import java.io.{ByteArrayInputStream, ByteArrayOutputStream, InputStream, OutputStream} import java.nio.{Buffer, ByteBuffer} @@ -6,15 +6,15 @@ import java.nio.{Buffer, ByteBuffer} import scala.annotation.{implicitNotFound, tailrec} package object internal { - private[client] def contentTypeWithCharset(ct: String, charset: String): String = + private[client3] def contentTypeWithCharset(ct: String, charset: String): String = s"$ct; charset=$charset" - private[client] def charsetFromContentType(ct: String): Option[String] = + private[client3] def charsetFromContentType(ct: String): Option[String] = ct.split(";").map(_.trim.toLowerCase).collectFirst { case s if s.startsWith("charset=") && s.substring(8).trim != "" => s.substring(8).trim } - private[client] def transfer(is: InputStream, os: OutputStream): Unit = { + private[client3] def transfer(is: InputStream, os: OutputStream): Unit = { var read = 0 val buf = new Array[Byte](IOBufferSize) @@ -30,15 +30,15 @@ package object internal { transfer() } - private[client] def toByteArray(is: InputStream): Array[Byte] = { + private[client3] def toByteArray(is: InputStream): Array[Byte] = { val os = new ByteArrayOutputStream transfer(is, os) os.toByteArray } - private[client] def emptyInputStream(): InputStream = new ByteArrayInputStream(Array[Byte]()) + private[client3] def emptyInputStream(): InputStream = new ByteArrayInputStream(Array[Byte]()) - private[client] def concatByteBuffers(bb1: ByteBuffer, bb2: ByteBuffer): ByteBuffer = { + private[client3] def concatByteBuffers(bb1: ByteBuffer, bb2: ByteBuffer): ByteBuffer = { val buf = ByteBuffer .allocate(bb1.array().length + bb2.array().length) .put(bb1) @@ -52,7 +52,7 @@ package object internal { /** * Removes quotes surrounding the charset. */ - private[client] def sanitizeCharset(charset: String): String = { + private[client3] def sanitizeCharset(charset: String): String = { val c2 = charset.trim() val c3 = if (c2.startsWith("\"")) c2.substring(1) else c2 if (c3.endsWith("\"")) c3.substring(0, c3.length - 1) else c3 @@ -62,21 +62,21 @@ package object internal { "This is a partial request, the method & url are not specified. Use " + ".get(...), .post(...) etc. to obtain a non-partial request." ) - private[client] type IsIdInRequest[U[_]] = U[Unit] =:= Identity[Unit] + private[client3] type IsIdInRequest[U[_]] = U[Unit] =:= Identity[Unit] - private[client] val Utf8 = "utf-8" - private[client] val Iso88591 = "iso-8859-1" - private[client] val CrLf = "\r\n" + private[client3] val Utf8 = "utf-8" + private[client3] val Iso88591 = "iso-8859-1" + private[client3] val CrLf = "\r\n" - private[client] def throwNestedMultipartNotAllowed = + private[client3] def throwNestedMultipartNotAllowed = throw new IllegalArgumentException("Nested multipart bodies are not allowed") - private[client] type ReplayableBody = Option[Either[Array[Byte], SttpFile]] - private[client] def replayableBody(a: Array[Byte]): ReplayableBody = Some(Left(a)) - private[client] def replayableBody(f: SttpFile): ReplayableBody = Some(Right(f)) - private[client] val nonReplayableBody: ReplayableBody = None + private[client3] type ReplayableBody = Option[Either[Array[Byte], SttpFile]] + private[client3] def replayableBody(a: Array[Byte]): ReplayableBody = Some(Left(a)) + private[client3] def replayableBody(f: SttpFile): ReplayableBody = Some(Right(f)) + private[client3] val nonReplayableBody: ReplayableBody = None - private[client] val IOBufferSize = 1024 + private[client3] val IOBufferSize = 1024 implicit class RichByteBuffer(byteBuffer: ByteBuffer) { def safeRead(): Array[Byte] = { diff --git a/core/src/main/scala/sttp/client/internal/ws/FutureSimpleQueue.scala b/core/src/main/scala/sttp/client3/internal/ws/FutureSimpleQueue.scala similarity index 96% rename from core/src/main/scala/sttp/client/internal/ws/FutureSimpleQueue.scala rename to core/src/main/scala/sttp/client3/internal/ws/FutureSimpleQueue.scala index 8f3d936e41..ca575a914c 100644 --- a/core/src/main/scala/sttp/client/internal/ws/FutureSimpleQueue.scala +++ b/core/src/main/scala/sttp/client3/internal/ws/FutureSimpleQueue.scala @@ -1,4 +1,4 @@ -package sttp.client.internal.ws +package sttp.client3.internal.ws import java.util.concurrent.{ArrayBlockingQueue, BlockingQueue, LinkedBlockingQueue} diff --git a/core/src/main/scala/sttp/client/internal/ws/SimpleQueue.scala b/core/src/main/scala/sttp/client3/internal/ws/SimpleQueue.scala similarity index 88% rename from core/src/main/scala/sttp/client/internal/ws/SimpleQueue.scala rename to core/src/main/scala/sttp/client3/internal/ws/SimpleQueue.scala index 1c29c339d9..711a6cc686 100644 --- a/core/src/main/scala/sttp/client/internal/ws/SimpleQueue.scala +++ b/core/src/main/scala/sttp/client3/internal/ws/SimpleQueue.scala @@ -1,4 +1,4 @@ -package sttp.client.internal.ws +package sttp.client3.internal.ws trait SimpleQueue[F[_], T] { diff --git a/core/src/main/scala/sttp/client/internal/ws/SyncQueue.scala b/core/src/main/scala/sttp/client3/internal/ws/SyncQueue.scala similarity index 92% rename from core/src/main/scala/sttp/client/internal/ws/SyncQueue.scala rename to core/src/main/scala/sttp/client3/internal/ws/SyncQueue.scala index 37d7bd510e..ab7b2a0ff9 100644 --- a/core/src/main/scala/sttp/client/internal/ws/SyncQueue.scala +++ b/core/src/main/scala/sttp/client3/internal/ws/SyncQueue.scala @@ -1,8 +1,8 @@ -package sttp.client.internal.ws +package sttp.client3.internal.ws import java.util.concurrent.{ArrayBlockingQueue, BlockingQueue, LinkedBlockingQueue} -import sttp.client.Identity +import sttp.client3.Identity import sttp.ws.WebSocketBufferFull class SyncQueue[T](capacity: Option[Int]) extends SimpleQueue[Identity, T] { diff --git a/core/src/main/scala/sttp/client/internal/ws/WebSocketEvent.scala b/core/src/main/scala/sttp/client3/internal/ws/WebSocketEvent.scala similarity index 88% rename from core/src/main/scala/sttp/client/internal/ws/WebSocketEvent.scala rename to core/src/main/scala/sttp/client3/internal/ws/WebSocketEvent.scala index 5ac5c417da..9dcb26dee8 100644 --- a/core/src/main/scala/sttp/client/internal/ws/WebSocketEvent.scala +++ b/core/src/main/scala/sttp/client3/internal/ws/WebSocketEvent.scala @@ -1,4 +1,4 @@ -package sttp.client.internal.ws +package sttp.client3.internal.ws import sttp.ws.WebSocketFrame diff --git a/core/src/main/scala/sttp/client/listener/ListenerBackend.scala b/core/src/main/scala/sttp/client3/listener/ListenerBackend.scala similarity index 95% rename from core/src/main/scala/sttp/client/listener/ListenerBackend.scala rename to core/src/main/scala/sttp/client3/listener/ListenerBackend.scala index f929360005..40484d6e37 100644 --- a/core/src/main/scala/sttp/client/listener/ListenerBackend.scala +++ b/core/src/main/scala/sttp/client3/listener/ListenerBackend.scala @@ -1,7 +1,7 @@ -package sttp.client.listener +package sttp.client3.listener import sttp.capabilities.Effect -import sttp.client._ +import sttp.client3._ import sttp.monad.MonadError import sttp.monad.syntax._ diff --git a/core/src/main/scala/sttp/client/listener/RequestListener.scala b/core/src/main/scala/sttp/client3/listener/RequestListener.scala similarity index 93% rename from core/src/main/scala/sttp/client/listener/RequestListener.scala rename to core/src/main/scala/sttp/client3/listener/RequestListener.scala index a9fb391509..b76207668c 100644 --- a/core/src/main/scala/sttp/client/listener/RequestListener.scala +++ b/core/src/main/scala/sttp/client3/listener/RequestListener.scala @@ -1,7 +1,7 @@ -package sttp.client.listener +package sttp.client3.listener import sttp.monad.MonadError -import sttp.client.{Identity, Request, Response} +import sttp.client3.{Identity, Request, Response} /** * A listener to be used by the [[ListenerBackend]] to get notified on request lifecycle events. diff --git a/core/src/main/scala/sttp/client/logging/Log.scala b/core/src/main/scala/sttp/client3/logging/Log.scala similarity index 96% rename from core/src/main/scala/sttp/client/logging/Log.scala rename to core/src/main/scala/sttp/client3/logging/Log.scala index 943739828b..f9ece8903f 100644 --- a/core/src/main/scala/sttp/client/logging/Log.scala +++ b/core/src/main/scala/sttp/client3/logging/Log.scala @@ -1,6 +1,6 @@ -package sttp.client.logging +package sttp.client3.logging -import sttp.client.{Request, Response} +import sttp.client3.{Request, Response} import sttp.model.HeaderNames import scala.concurrent.duration.Duration diff --git a/core/src/main/scala/sttp/client/logging/Logger.scala b/core/src/main/scala/sttp/client3/logging/Logger.scala similarity index 93% rename from core/src/main/scala/sttp/client/logging/Logger.scala rename to core/src/main/scala/sttp/client3/logging/Logger.scala index 489ec54372..8eb2497be9 100644 --- a/core/src/main/scala/sttp/client/logging/Logger.scala +++ b/core/src/main/scala/sttp/client3/logging/Logger.scala @@ -1,4 +1,4 @@ -package sttp.client.logging +package sttp.client3.logging /** * Interfaces with a logger system. diff --git a/core/src/main/scala/sttp/client/logging/LoggingBackend.scala b/core/src/main/scala/sttp/client3/logging/LoggingBackend.scala similarity index 96% rename from core/src/main/scala/sttp/client/logging/LoggingBackend.scala rename to core/src/main/scala/sttp/client3/logging/LoggingBackend.scala index 6452527519..4f6cb336e9 100644 --- a/core/src/main/scala/sttp/client/logging/LoggingBackend.scala +++ b/core/src/main/scala/sttp/client3/logging/LoggingBackend.scala @@ -1,10 +1,10 @@ -package sttp.client.logging +package sttp.client3.logging import java.util.concurrent.TimeUnit import sttp.capabilities.Effect -import sttp.client._ -import sttp.client.listener.{ListenerBackend, RequestListener} +import sttp.client3._ +import sttp.client3.listener.{ListenerBackend, RequestListener} import sttp.model.HeaderNames import sttp.monad.MonadError import sttp.monad.syntax._ diff --git a/core/src/main/scala/sttp/client/monad/FunctionK.scala b/core/src/main/scala/sttp/client3/monad/FunctionK.scala similarity index 70% rename from core/src/main/scala/sttp/client/monad/FunctionK.scala rename to core/src/main/scala/sttp/client3/monad/FunctionK.scala index b0ba6b3e1c..2a8778859f 100644 --- a/core/src/main/scala/sttp/client/monad/FunctionK.scala +++ b/core/src/main/scala/sttp/client3/monad/FunctionK.scala @@ -1,4 +1,4 @@ -package sttp.client.monad +package sttp.client3.monad trait FunctionK[F[_], G[_]] { def apply[A](fa: F[A]): G[A] diff --git a/core/src/main/scala/sttp/client/monad/IdMonad.scala b/core/src/main/scala/sttp/client3/monad/IdMonad.scala similarity index 92% rename from core/src/main/scala/sttp/client/monad/IdMonad.scala rename to core/src/main/scala/sttp/client3/monad/IdMonad.scala index e8e3b32712..99d32214d9 100644 --- a/core/src/main/scala/sttp/client/monad/IdMonad.scala +++ b/core/src/main/scala/sttp/client3/monad/IdMonad.scala @@ -1,6 +1,6 @@ -package sttp.client.monad +package sttp.client3.monad -import sttp.client.Identity +import sttp.client3.Identity import sttp.monad.MonadError object IdMonad extends MonadError[Identity] { diff --git a/core/src/main/scala/sttp/client/monad/MapEffect.scala b/core/src/main/scala/sttp/client3/monad/MapEffect.scala similarity index 99% rename from core/src/main/scala/sttp/client/monad/MapEffect.scala rename to core/src/main/scala/sttp/client3/monad/MapEffect.scala index 508909b090..25b34aa363 100644 --- a/core/src/main/scala/sttp/client/monad/MapEffect.scala +++ b/core/src/main/scala/sttp/client3/monad/MapEffect.scala @@ -1,7 +1,7 @@ -package sttp.client.monad +package sttp.client3.monad import sttp.capabilities.Effect -import sttp.client.{ +import sttp.client3.{ ConditionalResponseAs, IgnoreResponse, MappedResponseAs, diff --git a/core/src/main/scala/sttp/client/package.scala b/core/src/main/scala/sttp/client3/package.scala similarity index 95% rename from core/src/main/scala/sttp/client/package.scala rename to core/src/main/scala/sttp/client3/package.scala index c7aeb49434..9407c1545f 100644 --- a/core/src/main/scala/sttp/client/package.scala +++ b/core/src/main/scala/sttp/client3/package.scala @@ -1,6 +1,6 @@ package sttp -package object client extends SttpApi { +package object client3 extends SttpApi { type Identity[X] = X type Empty[X] = None.type diff --git a/core/src/main/scala/sttp/client/testing/RecordingSttpBackend.scala b/core/src/main/scala/sttp/client3/testing/RecordingSttpBackend.scala similarity index 94% rename from core/src/main/scala/sttp/client/testing/RecordingSttpBackend.scala rename to core/src/main/scala/sttp/client3/testing/RecordingSttpBackend.scala index 6bed9b6c95..5a76471d1a 100644 --- a/core/src/main/scala/sttp/client/testing/RecordingSttpBackend.scala +++ b/core/src/main/scala/sttp/client3/testing/RecordingSttpBackend.scala @@ -1,10 +1,10 @@ -package sttp.client.testing +package sttp.client3.testing import java.util.concurrent.atomic.AtomicReference import java.util.function.UnaryOperator import sttp.capabilities.Effect -import sttp.client.{Request, Response, SttpBackend} +import sttp.client3.{Request, Response, SttpBackend} import sttp.monad.MonadError import sttp.monad.syntax._ diff --git a/core/src/main/scala/sttp/client/testing/SttpBackendStub.scala b/core/src/main/scala/sttp/client3/testing/SttpBackendStub.scala similarity index 96% rename from core/src/main/scala/sttp/client/testing/SttpBackendStub.scala rename to core/src/main/scala/sttp/client3/testing/SttpBackendStub.scala index d16d5602d3..1efad165c7 100644 --- a/core/src/main/scala/sttp/client/testing/SttpBackendStub.scala +++ b/core/src/main/scala/sttp/client3/testing/SttpBackendStub.scala @@ -1,12 +1,12 @@ -package sttp.client.testing +package sttp.client3.testing import java.io.InputStream import sttp.capabilities.{Effect, WebSockets} -import sttp.client.internal.{SttpFile, _} -import sttp.client.monad.IdMonad -import sttp.client.testing.SttpBackendStub._ -import sttp.client.{IgnoreResponse, ResponseAs, ResponseAsByteArray, SttpBackend, _} +import sttp.client3.internal.{SttpFile, _} +import sttp.client3.monad.IdMonad +import sttp.client3.testing.SttpBackendStub._ +import sttp.client3.{IgnoreResponse, ResponseAs, ResponseAsByteArray, SttpBackend, _} import sttp.model.StatusCode import sttp.monad.{FutureMonad, MonadError} import sttp.monad.syntax._ @@ -194,7 +194,7 @@ object SttpBackendStub { Some(fallback) ) - private[client] def tryAdjustResponseType[DesiredRType, RType, F[_]]( + private[client3] def tryAdjustResponseType[DesiredRType, RType, F[_]]( ra: ResponseAs[DesiredRType, _], m: F[Response[RType]] )(implicit monad: MonadError[F]): F[Response[DesiredRType]] = { @@ -205,7 +205,7 @@ object SttpBackendStub { } } - private[client] def tryAdjustResponseBody[F[_], T, U]( + private[client3] def tryAdjustResponseBody[F[_], T, U]( ra: ResponseAs[T, _], b: U, meta: ResponseMetadata diff --git a/core/src/main/scala/sttp/client/testing/package.scala b/core/src/main/scala/sttp/client3/testing/package.scala similarity index 94% rename from core/src/main/scala/sttp/client/testing/package.scala rename to core/src/main/scala/sttp/client3/testing/package.scala index 1cb23fa4bf..ca5e0ba02b 100644 --- a/core/src/main/scala/sttp/client/testing/package.scala +++ b/core/src/main/scala/sttp/client3/testing/package.scala @@ -1,6 +1,6 @@ -package sttp.client +package sttp.client3 -import sttp.client.internal.toByteArray +import sttp.client3.internal.toByteArray package object testing { implicit class RichTestingRequest[T](r: Request[T, _]) { diff --git a/core/src/main/scala/sttp/client/ws/exceptions.scala b/core/src/main/scala/sttp/client3/ws/exceptions.scala similarity index 91% rename from core/src/main/scala/sttp/client/ws/exceptions.scala rename to core/src/main/scala/sttp/client3/ws/exceptions.scala index e335529acb..45184f9d57 100644 --- a/core/src/main/scala/sttp/client/ws/exceptions.scala +++ b/core/src/main/scala/sttp/client3/ws/exceptions.scala @@ -1,4 +1,4 @@ -package sttp.client.ws +package sttp.client3.ws import sttp.model.StatusCode diff --git a/core/src/main/scalajs/sttp/client/AbstractFetchBackend.scala b/core/src/main/scalajs/sttp/client3/AbstractFetchBackend.scala similarity index 97% rename from core/src/main/scalajs/sttp/client/AbstractFetchBackend.scala rename to core/src/main/scalajs/sttp/client3/AbstractFetchBackend.scala index a239a5e70d..6b8e99c91d 100644 --- a/core/src/main/scalajs/sttp/client/AbstractFetchBackend.scala +++ b/core/src/main/scalajs/sttp/client3/AbstractFetchBackend.scala @@ -1,4 +1,4 @@ -package sttp.client +package sttp.client3 import java.nio.ByteBuffer @@ -19,9 +19,9 @@ import org.scalajs.dom.experimental.{ } import org.scalajs.dom.raw.{Blob, BlobPropertyBag} import sttp.capabilities.{Effect, Streams} -import sttp.client.dom.experimental.{AbortController, FilePropertyBag, File => DomFile} -import sttp.client.internal.{SttpFile, _} -import sttp.client.ws.{NotAWebSocketException, GotAWebSocketException} +import sttp.client3.dom.experimental.{AbortController, FilePropertyBag, File => DomFile} +import sttp.client3.internal.{SttpFile, _} +import sttp.client3.ws.{NotAWebSocketException, GotAWebSocketException} import sttp.monad.MonadError import sttp.monad.syntax._ import sttp.model.{Header, StatusCode} diff --git a/core/src/main/scalajs/sttp/client/FetchBackend.scala b/core/src/main/scalajs/sttp/client3/FetchBackend.scala similarity index 94% rename from core/src/main/scalajs/sttp/client/FetchBackend.scala rename to core/src/main/scalajs/sttp/client3/FetchBackend.scala index 8bf819135d..4e0fb30c8d 100644 --- a/core/src/main/scalajs/sttp/client/FetchBackend.scala +++ b/core/src/main/scalajs/sttp/client3/FetchBackend.scala @@ -1,4 +1,4 @@ -package sttp.client +package sttp.client3 import org.scalajs.dom.experimental.{BodyInit, Response => FetchResponse} import sttp.monad.FutureMonad @@ -7,8 +7,8 @@ import scala.concurrent.{ExecutionContext, Future} import scala.scalajs.js import scala.scalajs.js.Promise import org.scalajs.dom.experimental.{Request => FetchRequest} -import sttp.client.testing.SttpBackendStub -import sttp.client.internal.NoStreams +import sttp.client3.testing.SttpBackendStub +import sttp.client3.internal.NoStreams class FetchBackend private (fetchOptions: FetchOptions, customizeRequest: FetchRequest => FetchRequest)(implicit ec: ExecutionContext diff --git a/core/src/main/scalajs/sttp/client/RequestTExtensions.scala b/core/src/main/scalajs/sttp/client3/RequestTExtensions.scala similarity index 87% rename from core/src/main/scalajs/sttp/client/RequestTExtensions.scala rename to core/src/main/scalajs/sttp/client3/RequestTExtensions.scala index d3112d1c1b..e5fa624ed6 100644 --- a/core/src/main/scalajs/sttp/client/RequestTExtensions.scala +++ b/core/src/main/scalajs/sttp/client3/RequestTExtensions.scala @@ -1,7 +1,7 @@ -package sttp.client +package sttp.client3 -import sttp.client.internal.SttpFile -import sttp.client.dom.experimental.File +import sttp.client3.internal.SttpFile +import sttp.client3.dom.experimental.File import scala.language.higherKinds diff --git a/core/src/main/scalajs/sttp/client/SttpExtensions.scala b/core/src/main/scalajs/sttp/client3/SttpExtensions.scala similarity index 86% rename from core/src/main/scalajs/sttp/client/SttpExtensions.scala rename to core/src/main/scalajs/sttp/client3/SttpExtensions.scala index ef48098fb8..0ee575fdf1 100644 --- a/core/src/main/scalajs/sttp/client/SttpExtensions.scala +++ b/core/src/main/scalajs/sttp/client3/SttpExtensions.scala @@ -1,7 +1,7 @@ -package sttp.client +package sttp.client3 -import sttp.client.dom.experimental.File -import sttp.client.internal.SttpFile +import sttp.client3.dom.experimental.File +import sttp.client3.internal.SttpFile import sttp.model.Part trait SttpExtensions { diff --git a/core/src/main/scalajs/sttp/client/ToCurlConverterTestExtension.scala b/core/src/main/scalajs/sttp/client3/ToCurlConverterTestExtension.scala similarity index 65% rename from core/src/main/scalajs/sttp/client/ToCurlConverterTestExtension.scala rename to core/src/main/scalajs/sttp/client3/ToCurlConverterTestExtension.scala index 8bed342af5..05a630ef7b 100644 --- a/core/src/main/scalajs/sttp/client/ToCurlConverterTestExtension.scala +++ b/core/src/main/scalajs/sttp/client3/ToCurlConverterTestExtension.scala @@ -1,3 +1,3 @@ -package sttp.client +package sttp.client3 trait ToCurlConverterTestExtension {} diff --git a/core/src/main/scalajs/sttp/client/dom/experimental/AbortController.scala b/core/src/main/scalajs/sttp/client3/dom/experimental/AbortController.scala similarity index 91% rename from core/src/main/scalajs/sttp/client/dom/experimental/AbortController.scala rename to core/src/main/scalajs/sttp/client3/dom/experimental/AbortController.scala index 4f31ae5f1b..88873b3380 100644 --- a/core/src/main/scalajs/sttp/client/dom/experimental/AbortController.scala +++ b/core/src/main/scalajs/sttp/client3/dom/experimental/AbortController.scala @@ -1,4 +1,4 @@ -package sttp.client.dom.experimental +package sttp.client3.dom.experimental import scala.scalajs.js import scala.scalajs.js.annotation.JSGlobal diff --git a/core/src/main/scalajs/sttp/client/dom/experimental/File.scala b/core/src/main/scalajs/sttp/client3/dom/experimental/File.scala similarity index 96% rename from core/src/main/scalajs/sttp/client/dom/experimental/File.scala rename to core/src/main/scalajs/sttp/client3/dom/experimental/File.scala index aa4cdfcd0f..1638c15c0b 100644 --- a/core/src/main/scalajs/sttp/client/dom/experimental/File.scala +++ b/core/src/main/scalajs/sttp/client3/dom/experimental/File.scala @@ -1,4 +1,4 @@ -package sttp.client.dom.experimental +package sttp.client3.dom.experimental import org.scalajs.dom.raw.Blob diff --git a/core/src/main/scalajs/sttp/client/internal/MessageDigestCompatibility.scala b/core/src/main/scalajs/sttp/client3/internal/MessageDigestCompatibility.scala similarity index 80% rename from core/src/main/scalajs/sttp/client/internal/MessageDigestCompatibility.scala rename to core/src/main/scalajs/sttp/client3/internal/MessageDigestCompatibility.scala index 87fa4eb42d..67d13e0559 100644 --- a/core/src/main/scalajs/sttp/client/internal/MessageDigestCompatibility.scala +++ b/core/src/main/scalajs/sttp/client3/internal/MessageDigestCompatibility.scala @@ -1,8 +1,8 @@ -package sttp.client.internal +package sttp.client3.internal import scala.scalajs.js.JSConverters._ -private[client] class MessageDigestCompatibility(algorithm: String) { +private[client3] class MessageDigestCompatibility(algorithm: String) { private lazy val md: scala.scalajs.js.typedarray.ArrayBuffer => String = algorithm match { case "MD5" => SparkMD5.ArrayBuffer.hash(_) case _ => throw new IllegalArgumentException(s"Unsupported algorithm: $algorithm") diff --git a/core/src/main/scalajs/sttp/client/internal/SparkMD5.scala b/core/src/main/scalajs/sttp/client3/internal/SparkMD5.scala similarity index 75% rename from core/src/main/scalajs/sttp/client/internal/SparkMD5.scala rename to core/src/main/scalajs/sttp/client3/internal/SparkMD5.scala index ec339bd05e..16291b3749 100644 --- a/core/src/main/scalajs/sttp/client/internal/SparkMD5.scala +++ b/core/src/main/scalajs/sttp/client3/internal/SparkMD5.scala @@ -1,11 +1,11 @@ -package sttp.client.internal +package sttp.client3.internal import scala.scalajs.js import scala.scalajs.js.annotation.JSGlobal @js.native @JSGlobal -private[client] object SparkMD5 extends js.Object { +private[client3] object SparkMD5 extends js.Object { @js.native object ArrayBuffer extends js.Object { def hash(arr: scala.scalajs.js.typedarray.ArrayBuffer, raw: Boolean = false): String = js.native diff --git a/core/src/main/scalajs/sttp/client/internal/SttpFileExtensions.scala b/core/src/main/scalajs/sttp/client3/internal/SttpFileExtensions.scala similarity index 75% rename from core/src/main/scalajs/sttp/client/internal/SttpFileExtensions.scala rename to core/src/main/scalajs/sttp/client3/internal/SttpFileExtensions.scala index 0b3b95f82d..da530c6677 100644 --- a/core/src/main/scalajs/sttp/client/internal/SttpFileExtensions.scala +++ b/core/src/main/scalajs/sttp/client3/internal/SttpFileExtensions.scala @@ -1,7 +1,7 @@ -package sttp.client.internal +package sttp.client3.internal -import sttp.client.dom.experimental.{File => DomFile} -import sttp.client.dom.experimental.File +import sttp.client3.dom.experimental.{File => DomFile} +import sttp.client3.dom.experimental.File // wrap a DomFile trait SttpFileExtensions { self: SttpFile => diff --git a/core/src/main/scalajs/sttp/client/quick.scala b/core/src/main/scalajs/sttp/client3/quick.scala similarity index 85% rename from core/src/main/scalajs/sttp/client/quick.scala rename to core/src/main/scalajs/sttp/client3/quick.scala index c118d9d6a2..6f52ddb260 100644 --- a/core/src/main/scalajs/sttp/client/quick.scala +++ b/core/src/main/scalajs/sttp/client3/quick.scala @@ -1,4 +1,4 @@ -package sttp.client +package sttp.client3 import scala.concurrent.Future diff --git a/core/src/main/scalajvm/sttp/client/HttpURLConnectionBackend.scala b/core/src/main/scalajvm/sttp/client3/HttpURLConnectionBackend.scala similarity index 96% rename from core/src/main/scalajvm/sttp/client/HttpURLConnectionBackend.scala rename to core/src/main/scalajvm/sttp/client3/HttpURLConnectionBackend.scala index 5e609ef769..ba0cee358b 100644 --- a/core/src/main/scalajvm/sttp/client/HttpURLConnectionBackend.scala +++ b/core/src/main/scalajvm/sttp/client3/HttpURLConnectionBackend.scala @@ -1,4 +1,4 @@ -package sttp.client +package sttp.client3 import java.io._ import java.net._ @@ -9,11 +9,11 @@ import java.util.concurrent.ThreadLocalRandom import java.util.zip.{GZIPInputStream, InflaterInputStream} import sttp.capabilities.Effect -import sttp.client.HttpURLConnectionBackend.EncodingHandler -import sttp.client.internal._ -import sttp.client.monad.IdMonad -import sttp.client.testing.SttpBackendStub -import sttp.client.ws.{GotAWebSocketException, NotAWebSocketException} +import sttp.client3.HttpURLConnectionBackend.EncodingHandler +import sttp.client3.internal._ +import sttp.client3.monad.IdMonad +import sttp.client3.testing.SttpBackendStub +import sttp.client3.ws.{GotAWebSocketException, NotAWebSocketException} import sttp.model.{Header, HeaderNames, StatusCode, Uri} import sttp.monad.MonadError @@ -300,7 +300,7 @@ object HttpURLConnectionBackend { type EncodingHandler = PartialFunction[(InputStream, String), InputStream] - private[client] val defaultOpenConnection: (URL, Option[java.net.Proxy]) => URLConnection = { + private[client3] val defaultOpenConnection: (URL, Option[java.net.Proxy]) => URLConnection = { case (url, None) => url.openConnection() case (url, Some(proxy)) => url.openConnection(proxy) } diff --git a/core/src/main/scalajvm/sttp/client/RequestTExtensions.scala b/core/src/main/scalajvm/sttp/client3/RequestTExtensions.scala similarity index 94% rename from core/src/main/scalajvm/sttp/client/RequestTExtensions.scala rename to core/src/main/scalajvm/sttp/client3/RequestTExtensions.scala index 52fff84305..ac206b3529 100644 --- a/core/src/main/scalajvm/sttp/client/RequestTExtensions.scala +++ b/core/src/main/scalajvm/sttp/client3/RequestTExtensions.scala @@ -1,9 +1,9 @@ -package sttp.client +package sttp.client3 import java.io.File import java.nio.file.Path -import sttp.client.internal.SttpFile +import sttp.client3.internal.SttpFile trait RequestTExtensions[U[_], T, -R] { self: RequestT[U, T, R] => diff --git a/core/src/main/scalajvm/sttp/client/SttpExtensions.scala b/core/src/main/scalajvm/sttp/client3/SttpExtensions.scala similarity index 95% rename from core/src/main/scalajvm/sttp/client/SttpExtensions.scala rename to core/src/main/scalajvm/sttp/client3/SttpExtensions.scala index 470b4cdb5e..2c8814c4c0 100644 --- a/core/src/main/scalajvm/sttp/client/SttpExtensions.scala +++ b/core/src/main/scalajvm/sttp/client3/SttpExtensions.scala @@ -1,9 +1,9 @@ -package sttp.client +package sttp.client3 import java.io.File import java.nio.file.Path -import sttp.client.internal.SttpFile +import sttp.client3.internal.SttpFile import sttp.model.Part trait SttpExtensions { diff --git a/core/src/main/scalajvm/sttp/client/TryHttpURLConnectionBackend.scala b/core/src/main/scalajvm/sttp/client3/TryHttpURLConnectionBackend.scala similarity index 85% rename from core/src/main/scalajvm/sttp/client/TryHttpURLConnectionBackend.scala rename to core/src/main/scalajvm/sttp/client3/TryHttpURLConnectionBackend.scala index 1419e40feb..ba93800007 100644 --- a/core/src/main/scalajvm/sttp/client/TryHttpURLConnectionBackend.scala +++ b/core/src/main/scalajvm/sttp/client3/TryHttpURLConnectionBackend.scala @@ -1,8 +1,8 @@ -package sttp.client +package sttp.client3 import java.net.{HttpURLConnection, URL, URLConnection} -import sttp.client.HttpURLConnectionBackend.{EncodingHandler, defaultOpenConnection} +import sttp.client3.HttpURLConnectionBackend.{EncodingHandler, defaultOpenConnection} import scala.util.Try diff --git a/core/src/main/scalajvm/sttp/client/internal/FileHelpers.scala b/core/src/main/scalajvm/sttp/client3/internal/FileHelpers.scala similarity index 94% rename from core/src/main/scalajvm/sttp/client/internal/FileHelpers.scala rename to core/src/main/scalajvm/sttp/client3/internal/FileHelpers.scala index 3280b5d04f..5517450b0a 100644 --- a/core/src/main/scalajvm/sttp/client/internal/FileHelpers.scala +++ b/core/src/main/scalajvm/sttp/client3/internal/FileHelpers.scala @@ -1,10 +1,10 @@ -package sttp.client.internal +package sttp.client3.internal import java.io.{BufferedInputStream, File, FileInputStream, FileOutputStream, InputStream} import scala.util.control.NonFatal -private[client] object FileHelpers { +private[client3] object FileHelpers { def saveFile(file: File, is: InputStream): Unit = { if (!file.exists()) { if (file.getParentFile != null) { diff --git a/core/src/main/scalajvm/sttp/client/internal/MessageDigestCompatibility.scala b/core/src/main/scalajvm/sttp/client3/internal/MessageDigestCompatibility.scala similarity index 62% rename from core/src/main/scalajvm/sttp/client/internal/MessageDigestCompatibility.scala rename to core/src/main/scalajvm/sttp/client3/internal/MessageDigestCompatibility.scala index 266cadbe69..4b3b420c30 100644 --- a/core/src/main/scalajvm/sttp/client/internal/MessageDigestCompatibility.scala +++ b/core/src/main/scalajvm/sttp/client3/internal/MessageDigestCompatibility.scala @@ -1,8 +1,8 @@ -package sttp.client.internal +package sttp.client3.internal import java.security.MessageDigest -private[client] class MessageDigestCompatibility(algorithm: String) { +private[client3] class MessageDigestCompatibility(algorithm: String) { private lazy val md = MessageDigest.getInstance(algorithm) def digest(input: Array[Byte]): Array[Byte] = md.digest(input) diff --git a/core/src/main/scalajvm/sttp/client/internal/SttpFileExtensions.scala b/core/src/main/scalajvm/sttp/client3/internal/SttpFileExtensions.scala similarity index 95% rename from core/src/main/scalajvm/sttp/client/internal/SttpFileExtensions.scala rename to core/src/main/scalajvm/sttp/client3/internal/SttpFileExtensions.scala index a12ca08808..48f54c5be9 100644 --- a/core/src/main/scalajvm/sttp/client/internal/SttpFileExtensions.scala +++ b/core/src/main/scalajvm/sttp/client3/internal/SttpFileExtensions.scala @@ -1,4 +1,4 @@ -package sttp.client.internal +package sttp.client3.internal import java.nio.file.Files import java.nio.file.Path diff --git a/core/src/main/scalajvm/sttp/client/quick.scala b/core/src/main/scalajvm/sttp/client3/quick.scala similarity index 83% rename from core/src/main/scalajvm/sttp/client/quick.scala rename to core/src/main/scalajvm/sttp/client3/quick.scala index 07f5fbb2a8..bef75cd947 100644 --- a/core/src/main/scalajvm/sttp/client/quick.scala +++ b/core/src/main/scalajvm/sttp/client3/quick.scala @@ -1,4 +1,4 @@ -package sttp.client +package sttp.client3 object quick extends SttpApi { lazy val backend: SttpBackend[Identity, Any] = HttpURLConnectionBackend() diff --git a/core/src/main/scalanative/sttp/client/curl/CurlList.scala b/core/src/main/scalanative/sttp/client/curl/CurlList.scala deleted file mode 100644 index 34eb02d340..0000000000 --- a/core/src/main/scalanative/sttp/client/curl/CurlList.scala +++ /dev/null @@ -1,5 +0,0 @@ -package sttp.client.curl - -import sttp.client.curl.CurlApi.SlistHandle - -class CurlList(val ptr: SlistHandle) extends AnyVal {} diff --git a/core/src/main/scalanative/sttp/client/AbstractCurlBackend.scala b/core/src/main/scalanative/sttp/client3/AbstractCurlBackend.scala similarity index 96% rename from core/src/main/scalanative/sttp/client/AbstractCurlBackend.scala rename to core/src/main/scalanative/sttp/client3/AbstractCurlBackend.scala index 187be8df45..7623a08eeb 100644 --- a/core/src/main/scalanative/sttp/client/AbstractCurlBackend.scala +++ b/core/src/main/scalanative/sttp/client3/AbstractCurlBackend.scala @@ -1,14 +1,14 @@ -package sttp.client +package sttp.client3 import java.io.ByteArrayInputStream -import sttp.client.curl.CurlApi._ -import sttp.client.curl.CurlCode.CurlCode -import sttp.client.curl.CurlInfo._ -import sttp.client.curl.CurlOption.{Header => _, _} -import sttp.client.curl._ -import sttp.client.internal._ -import sttp.client.ws.{NotAWebSocketException, GotAWebSocketException} +import sttp.client3.curl.CurlApi._ +import sttp.client3.curl.CurlCode.CurlCode +import sttp.client3.curl.CurlInfo._ +import sttp.client3.curl.CurlOption.{Header => _, _} +import sttp.client3.curl._ +import sttp.client3.internal._ +import sttp.client3.ws.{NotAWebSocketException, GotAWebSocketException} import sttp.capabilities.Effect import sttp.model._ import sttp.monad.MonadError diff --git a/core/src/main/scalanative/sttp/client/CurlBackends.scala b/core/src/main/scalanative/sttp/client3/CurlBackends.scala similarity index 93% rename from core/src/main/scalanative/sttp/client/CurlBackends.scala rename to core/src/main/scalanative/sttp/client3/CurlBackends.scala index 9d2352855d..a7cb0a9c21 100644 --- a/core/src/main/scalanative/sttp/client/CurlBackends.scala +++ b/core/src/main/scalanative/sttp/client3/CurlBackends.scala @@ -1,6 +1,6 @@ -package sttp.client +package sttp.client3 -import sttp.client.monad.IdMonad +import sttp.client3.monad.IdMonad import sttp.monad.TryMonad import scala.util.Try diff --git a/core/src/main/scalanative/sttp/client/FileHelpers.scala b/core/src/main/scalanative/sttp/client3/FileHelpers.scala similarity index 80% rename from core/src/main/scalanative/sttp/client/FileHelpers.scala rename to core/src/main/scalanative/sttp/client3/FileHelpers.scala index c4216ff857..1a5d517279 100644 --- a/core/src/main/scalanative/sttp/client/FileHelpers.scala +++ b/core/src/main/scalanative/sttp/client3/FileHelpers.scala @@ -1,12 +1,12 @@ -package sttp.client +package sttp.client3 import java.io.{File, FileOutputStream, IOException, InputStream} import java.nio.file.AccessDeniedException -import sttp.client.internal._ +import sttp.client3.internal._ object FileHelpers { - private[client] def saveFile(file: File, is: InputStream): File = { + private[client3] def saveFile(file: File, is: InputStream): File = { if (!file.exists()) { if (file.getParentFile != null) { file.getParentFile.mkdirs() diff --git a/core/src/main/scalanative/sttp/client/RequestTExtensions.scala b/core/src/main/scalanative/sttp/client3/RequestTExtensions.scala similarity index 95% rename from core/src/main/scalanative/sttp/client/RequestTExtensions.scala rename to core/src/main/scalanative/sttp/client3/RequestTExtensions.scala index 100d5bcf29..645005dec4 100644 --- a/core/src/main/scalanative/sttp/client/RequestTExtensions.scala +++ b/core/src/main/scalanative/sttp/client3/RequestTExtensions.scala @@ -1,9 +1,9 @@ -package sttp.client +package sttp.client3 import java.io.File import java.nio.file.Path -import sttp.client.internal._ +import sttp.client3.internal._ import scala.language.higherKinds diff --git a/core/src/main/scalanative/sttp/client/SttpExtensions.scala b/core/src/main/scalanative/sttp/client3/SttpExtensions.scala similarity index 95% rename from core/src/main/scalanative/sttp/client/SttpExtensions.scala rename to core/src/main/scalanative/sttp/client3/SttpExtensions.scala index bf6707d80a..2f65091df7 100644 --- a/core/src/main/scalanative/sttp/client/SttpExtensions.scala +++ b/core/src/main/scalanative/sttp/client3/SttpExtensions.scala @@ -1,9 +1,9 @@ -package sttp.client +package sttp.client3 import java.io.File import java.nio.file.Path -import sttp.client.internal.SttpFile +import sttp.client3.internal.SttpFile import sttp.model.Part trait SttpExtensions { diff --git a/core/src/main/scalanative/sttp/client/curl/CCurl.scala b/core/src/main/scalanative/sttp/client3/curl/CCurl.scala similarity index 96% rename from core/src/main/scalanative/sttp/client/curl/CCurl.scala rename to core/src/main/scalanative/sttp/client3/curl/CCurl.scala index 4613769e38..1af62278f2 100644 --- a/core/src/main/scalanative/sttp/client/curl/CCurl.scala +++ b/core/src/main/scalanative/sttp/client3/curl/CCurl.scala @@ -1,6 +1,6 @@ -package sttp.client.curl +package sttp.client3.curl -import sttp.client.curl.CurlCode.CurlCode +import sttp.client3.curl.CurlCode.CurlCode import scala.scalanative.unsafe._ diff --git a/core/src/main/scalanative/sttp/client/curl/CurlApi.scala b/core/src/main/scalanative/sttp/client3/curl/CurlApi.scala similarity index 95% rename from core/src/main/scalanative/sttp/client/curl/CurlApi.scala rename to core/src/main/scalanative/sttp/client3/curl/CurlApi.scala index 1a5f6c6324..039cb34a84 100644 --- a/core/src/main/scalanative/sttp/client/curl/CurlApi.scala +++ b/core/src/main/scalanative/sttp/client3/curl/CurlApi.scala @@ -1,13 +1,13 @@ -package sttp.client.curl +package sttp.client3.curl -import sttp.client.curl.CurlCode.CurlCode -import sttp.client.curl.CurlInfo.CurlInfo -import sttp.client.curl.CurlOption.CurlOption +import sttp.client3.curl.CurlCode.CurlCode +import sttp.client3.curl.CurlInfo.CurlInfo +import sttp.client3.curl.CurlOption.CurlOption import scala.scalanative.runtime.Boxes import scala.scalanative.unsafe.{Ptr, _} -private[client] object CurlApi { +private[client3] object CurlApi { type CurlHandle = Ptr[Curl] type MimeHandle = Ptr[Mime] diff --git a/core/src/main/scalanative/sttp/client/curl/CurlCode.scala b/core/src/main/scalanative/sttp/client3/curl/CurlCode.scala similarity index 98% rename from core/src/main/scalanative/sttp/client/curl/CurlCode.scala rename to core/src/main/scalanative/sttp/client3/curl/CurlCode.scala index dd43d8144b..b9b5eec000 100644 --- a/core/src/main/scalanative/sttp/client/curl/CurlCode.scala +++ b/core/src/main/scalanative/sttp/client3/curl/CurlCode.scala @@ -1,6 +1,6 @@ -package sttp.client.curl +package sttp.client3.curl -private[client] object CurlCode extends Enumeration { +private[client3] object CurlCode extends Enumeration { type CurlCode = Value val Ok = Value(0, "OK") val UnsupportedProtocol = Value(1, "UNSUPPORTED_PROTOCOL") diff --git a/core/src/main/scalanative/sttp/client/curl/CurlInfo.scala b/core/src/main/scalanative/sttp/client3/curl/CurlInfo.scala similarity index 97% rename from core/src/main/scalanative/sttp/client/curl/CurlInfo.scala rename to core/src/main/scalanative/sttp/client3/curl/CurlInfo.scala index 832c804656..f69edcbe36 100644 --- a/core/src/main/scalanative/sttp/client/curl/CurlInfo.scala +++ b/core/src/main/scalanative/sttp/client3/curl/CurlInfo.scala @@ -1,6 +1,6 @@ -package sttp.client.curl +package sttp.client3.curl -private[client] object CurlInfo extends Enumeration { +private[client3] object CurlInfo extends Enumeration { type CurlInfo = Value private val String: Int = 0x100000 diff --git a/core/src/main/scalanative/sttp/client3/curl/CurlList.scala b/core/src/main/scalanative/sttp/client3/curl/CurlList.scala new file mode 100644 index 0000000000..e431268a09 --- /dev/null +++ b/core/src/main/scalanative/sttp/client3/curl/CurlList.scala @@ -0,0 +1,5 @@ +package sttp.client3.curl + +import sttp.client3.curl.CurlApi.SlistHandle + +class CurlList(val ptr: SlistHandle) extends AnyVal {} diff --git a/core/src/main/scalanative/sttp/client/curl/CurlOption.scala b/core/src/main/scalanative/sttp/client3/curl/CurlOption.scala similarity index 99% rename from core/src/main/scalanative/sttp/client/curl/CurlOption.scala rename to core/src/main/scalanative/sttp/client3/curl/CurlOption.scala index d0adca894e..6fee17cef8 100644 --- a/core/src/main/scalanative/sttp/client/curl/CurlOption.scala +++ b/core/src/main/scalanative/sttp/client3/curl/CurlOption.scala @@ -1,6 +1,6 @@ -package sttp.client.curl +package sttp.client3.curl -private[client] object CurlOption extends Enumeration { +private[client3] object CurlOption extends Enumeration { type CurlOption = Value /** * This is the FILE * or void * the regular output should be written to. diff --git a/core/src/main/scalanative/sttp/client/curl/CurlSpaces.scala b/core/src/main/scalanative/sttp/client3/curl/CurlSpaces.scala similarity index 84% rename from core/src/main/scalanative/sttp/client/curl/CurlSpaces.scala rename to core/src/main/scalanative/sttp/client3/curl/CurlSpaces.scala index 65820ae2e5..700fafb409 100644 --- a/core/src/main/scalanative/sttp/client/curl/CurlSpaces.scala +++ b/core/src/main/scalanative/sttp/client3/curl/CurlSpaces.scala @@ -1,4 +1,4 @@ -package sttp.client.curl +package sttp.client3.curl import scala.scalanative.unsafe.Ptr diff --git a/core/src/main/scalanative/sttp/client/curl/package.scala b/core/src/main/scalanative/sttp/client3/curl/package.scala similarity index 90% rename from core/src/main/scalanative/sttp/client/curl/package.scala rename to core/src/main/scalanative/sttp/client3/curl/package.scala index 64078c6176..311e77af88 100644 --- a/core/src/main/scalanative/sttp/client/curl/package.scala +++ b/core/src/main/scalanative/sttp/client3/curl/package.scala @@ -1,4 +1,4 @@ -package sttp.client +package sttp.client3 import scala.scalanative.unsafe.{CSize, CString, CStruct2, Ptr} diff --git a/core/src/main/scalanative/sttp/client/internal/CryptoMd5.scala b/core/src/main/scalanative/sttp/client3/internal/CryptoMd5.scala similarity index 94% rename from core/src/main/scalanative/sttp/client/internal/CryptoMd5.scala rename to core/src/main/scalanative/sttp/client3/internal/CryptoMd5.scala index 2a0ccca458..fe65d994df 100644 --- a/core/src/main/scalanative/sttp/client/internal/CryptoMd5.scala +++ b/core/src/main/scalanative/sttp/client3/internal/CryptoMd5.scala @@ -1,4 +1,4 @@ -package sttp.client.internal +package sttp.client3.internal import scala.scalanative.unsafe._ import scala.scalanative.libc.string.strlen diff --git a/core/src/main/scalanative/sttp/client/internal/MessageDigestCompatibility.scala b/core/src/main/scalanative/sttp/client3/internal/MessageDigestCompatibility.scala similarity index 59% rename from core/src/main/scalanative/sttp/client/internal/MessageDigestCompatibility.scala rename to core/src/main/scalanative/sttp/client3/internal/MessageDigestCompatibility.scala index db144d1768..9ac9b9f503 100644 --- a/core/src/main/scalanative/sttp/client/internal/MessageDigestCompatibility.scala +++ b/core/src/main/scalanative/sttp/client3/internal/MessageDigestCompatibility.scala @@ -1,6 +1,6 @@ -package sttp.client.internal +package sttp.client3.internal -private[client] class MessageDigestCompatibility(algorithm: String) { +private[client3] class MessageDigestCompatibility(algorithm: String) { require(algorithm == "MD5", s"Unsupported algorithm: $algorithm") def digest(input: Array[Byte]): Array[Byte] = diff --git a/core/src/main/scalanative/sttp/client/internal/SttpFileExtensions.scala b/core/src/main/scalanative/sttp/client3/internal/SttpFileExtensions.scala similarity index 95% rename from core/src/main/scalanative/sttp/client/internal/SttpFileExtensions.scala rename to core/src/main/scalanative/sttp/client3/internal/SttpFileExtensions.scala index 1219e9f42a..1dce7343e6 100644 --- a/core/src/main/scalanative/sttp/client/internal/SttpFileExtensions.scala +++ b/core/src/main/scalanative/sttp/client3/internal/SttpFileExtensions.scala @@ -1,4 +1,4 @@ -package sttp.client.internal +package sttp.client3.internal import java.nio.file.Files import java.nio.file.Path diff --git a/core/src/main/scalanative/sttp/client/quick.scala b/core/src/main/scalanative/sttp/client3/quick.scala similarity index 82% rename from core/src/main/scalanative/sttp/client/quick.scala rename to core/src/main/scalanative/sttp/client3/quick.scala index edd56ba6c3..45a49ba6f4 100644 --- a/core/src/main/scalanative/sttp/client/quick.scala +++ b/core/src/main/scalanative/sttp/client3/quick.scala @@ -1,4 +1,4 @@ -package sttp.client +package sttp.client3 object quick extends SttpApi { lazy val backend: SttpBackend[Identity, Any] = CurlBackend() diff --git a/core/src/test/scala/sttp/client/FollowRedirectsBackendTest.scala b/core/src/test/scala/sttp/client3/FollowRedirectsBackendTest.scala similarity index 97% rename from core/src/test/scala/sttp/client/FollowRedirectsBackendTest.scala rename to core/src/test/scala/sttp/client3/FollowRedirectsBackendTest.scala index e23983659c..3fb440a8b1 100644 --- a/core/src/test/scala/sttp/client/FollowRedirectsBackendTest.scala +++ b/core/src/test/scala/sttp/client3/FollowRedirectsBackendTest.scala @@ -1,4 +1,4 @@ -package sttp.client +package sttp.client3 import org.scalatest.funsuite.AnyFunSuite import org.scalatest.matchers.should.Matchers diff --git a/core/src/test/scala/sttp/client/RequestTests.scala b/core/src/test/scala/sttp/client3/RequestTests.scala similarity index 99% rename from core/src/test/scala/sttp/client/RequestTests.scala rename to core/src/test/scala/sttp/client3/RequestTests.scala index a13ed99ae4..f846e126f7 100644 --- a/core/src/test/scala/sttp/client/RequestTests.scala +++ b/core/src/test/scala/sttp/client3/RequestTests.scala @@ -1,4 +1,4 @@ -package sttp.client +package sttp.client3 import sttp.model.{HeaderNames, StatusCode} import org.scalatest.flatspec.AnyFlatSpec diff --git a/core/src/test/scala/sttp/client/RetryWhenDefaultTest.scala b/core/src/test/scala/sttp/client3/RetryWhenDefaultTest.scala similarity index 79% rename from core/src/test/scala/sttp/client/RetryWhenDefaultTest.scala rename to core/src/test/scala/sttp/client3/RetryWhenDefaultTest.scala index 505fff0af0..60402dd37b 100644 --- a/core/src/test/scala/sttp/client/RetryWhenDefaultTest.scala +++ b/core/src/test/scala/sttp/client3/RetryWhenDefaultTest.scala @@ -1,10 +1,10 @@ -package sttp.client +package sttp.client3 import java.io.ByteArrayInputStream import org.scalatest.flatspec.AnyFlatSpec import org.scalatest.matchers.should.Matchers -import sttp.client +import sttp.client3 import sttp.model.StatusCode class RetryWhenDefaultTest extends AnyFlatSpec with Matchers { @@ -21,14 +21,14 @@ class RetryWhenDefaultTest extends AnyFlatSpec with Matchers { it should "retry connection exceptions" in { RetryWhen.Default( simpleRequest, - Left(new client.SttpClientException.ConnectException(basicRequest.get(uri"http://example.com"), null)) + Left(new client3.SttpClientException.ConnectException(basicRequest.get(uri"http://example.com"), null)) ) shouldBe true } it should "not retry read exceptions" in { RetryWhen.Default( simpleRequest, - Left(new client.SttpClientException.ReadException(basicRequest.get(uri"http://example.com"), null)) + Left(new client3.SttpClientException.ReadException(basicRequest.get(uri"http://example.com"), null)) ) shouldBe false } diff --git a/core/src/test/scala/sttp/client/SttpBackendOptionsProxyTest.scala b/core/src/test/scala/sttp/client3/SttpBackendOptionsProxyTest.scala similarity index 98% rename from core/src/test/scala/sttp/client/SttpBackendOptionsProxyTest.scala rename to core/src/test/scala/sttp/client3/SttpBackendOptionsProxyTest.scala index 3e87bda012..70f4bcdf5a 100644 --- a/core/src/test/scala/sttp/client/SttpBackendOptionsProxyTest.scala +++ b/core/src/test/scala/sttp/client3/SttpBackendOptionsProxyTest.scala @@ -1,4 +1,4 @@ -package sttp.client +package sttp.client3 import org.scalatest.flatspec.AnyFlatSpec import org.scalatest.matchers.should.Matchers diff --git a/core/src/test/scala/sttp/client/ToCurlConverterTest.scala b/core/src/test/scala/sttp/client3/ToCurlConverterTest.scala similarity index 99% rename from core/src/test/scala/sttp/client/ToCurlConverterTest.scala rename to core/src/test/scala/sttp/client3/ToCurlConverterTest.scala index aa14ae0791..b3ad2e8c41 100644 --- a/core/src/test/scala/sttp/client/ToCurlConverterTest.scala +++ b/core/src/test/scala/sttp/client3/ToCurlConverterTest.scala @@ -1,4 +1,4 @@ -package sttp.client +package sttp.client3 import java.io.ByteArrayInputStream import java.nio.charset.StandardCharsets diff --git a/core/src/test/scala/sttp/client/internal/DigestAuthenticatorTest.scala b/core/src/test/scala/sttp/client3/internal/DigestAuthenticatorTest.scala similarity index 98% rename from core/src/test/scala/sttp/client/internal/DigestAuthenticatorTest.scala rename to core/src/test/scala/sttp/client3/internal/DigestAuthenticatorTest.scala index 58fee39b7d..090dfb0ead 100644 --- a/core/src/test/scala/sttp/client/internal/DigestAuthenticatorTest.scala +++ b/core/src/test/scala/sttp/client3/internal/DigestAuthenticatorTest.scala @@ -1,8 +1,8 @@ -package sttp.client.internal +package sttp.client3.internal import org.scalatest.OptionValues -import sttp.client.internal.DigestAuthenticator.DigestAuthData -import sttp.client._ +import sttp.client3.internal.DigestAuthenticator.DigestAuthData +import sttp.client3._ import sttp.model.{Header, HeaderNames, StatusCode} import scala.util.{Failure, Try} diff --git a/core/src/test/scala/sttp/client/internal/WwwAuthHeaderParserTest.scala b/core/src/test/scala/sttp/client3/internal/WwwAuthHeaderParserTest.scala similarity index 98% rename from core/src/test/scala/sttp/client/internal/WwwAuthHeaderParserTest.scala rename to core/src/test/scala/sttp/client3/internal/WwwAuthHeaderParserTest.scala index 2e603b162e..f4f8aecae9 100644 --- a/core/src/test/scala/sttp/client/internal/WwwAuthHeaderParserTest.scala +++ b/core/src/test/scala/sttp/client3/internal/WwwAuthHeaderParserTest.scala @@ -1,4 +1,4 @@ -package sttp.client.internal +package sttp.client3.internal import org.scalatest.flatspec.AnyFlatSpec import org.scalatest.matchers.should.Matchers diff --git a/core/src/test/scala/sttp/client/testing/CancelTest.scala b/core/src/test/scala/sttp/client3/testing/CancelTest.scala similarity index 91% rename from core/src/test/scala/sttp/client/testing/CancelTest.scala rename to core/src/test/scala/sttp/client3/testing/CancelTest.scala index a408efb34b..49587921e3 100644 --- a/core/src/test/scala/sttp/client/testing/CancelTest.scala +++ b/core/src/test/scala/sttp/client3/testing/CancelTest.scala @@ -1,12 +1,12 @@ -package sttp.client.testing +package sttp.client3.testing import org.scalatest.BeforeAndAfterAll import org.scalatest.freespec.AsyncFreeSpecLike import org.scalatest.matchers.should.Matchers -import sttp.client._ +import sttp.client3._ import sttp.monad.MonadError -import sttp.client.testing.HttpTest.endpoint +import sttp.client3.testing.HttpTest.endpoint trait CancelTest[F[_], P] extends AsyncFreeSpecLike with Matchers with ToFutureWrapper with BeforeAndAfterAll { diff --git a/core/src/test/scala/sttp/client/testing/ConvertToFuture.scala b/core/src/test/scala/sttp/client3/testing/ConvertToFuture.scala similarity index 91% rename from core/src/test/scala/sttp/client/testing/ConvertToFuture.scala rename to core/src/test/scala/sttp/client3/testing/ConvertToFuture.scala index a209756ea5..642aed7848 100644 --- a/core/src/test/scala/sttp/client/testing/ConvertToFuture.scala +++ b/core/src/test/scala/sttp/client3/testing/ConvertToFuture.scala @@ -1,6 +1,6 @@ -package sttp.client.testing +package sttp.client3.testing -import sttp.client.Identity +import sttp.client3.Identity import scala.concurrent.Future import scala.util.Try diff --git a/core/src/test/scala/sttp/client/testing/HttpTest.scala b/core/src/test/scala/sttp/client3/testing/HttpTest.scala similarity index 98% rename from core/src/test/scala/sttp/client/testing/HttpTest.scala rename to core/src/test/scala/sttp/client3/testing/HttpTest.scala index eb48ebf0a3..51f4b0f9cd 100644 --- a/core/src/test/scala/sttp/client/testing/HttpTest.scala +++ b/core/src/test/scala/sttp/client3/testing/HttpTest.scala @@ -1,4 +1,4 @@ -package sttp.client.testing +package sttp.client3.testing import java.io.{ByteArrayInputStream, UnsupportedEncodingException} import java.nio.ByteBuffer @@ -6,8 +6,8 @@ import java.nio.ByteBuffer import org.scalatest._ import org.scalatest.freespec.AsyncFreeSpecLike import org.scalatest.matchers.should.Matchers -import sttp.client.testing.HttpTest.endpoint -import sttp.client.{Response, ResponseAs, SttpBackend, _} +import sttp.client3.testing.HttpTest.endpoint +import sttp.client3.{Response, ResponseAs, SttpBackend, _} import sttp.model.StatusCode import scala.concurrent.Future @@ -36,7 +36,7 @@ trait HttpTest[F[_]] protected val customEncoding = "custom" protected val customEncodedData = "custom-data" - protected val sttpIgnore: ResponseAs[Unit, Any] = sttp.client.ignore + protected val sttpIgnore: ResponseAs[Unit, Any] = sttp.client3.ignore protected def supportsRequestTimeout = true protected def supportsSttpExceptions = true diff --git a/core/src/test/scala/sttp/client/testing/SttpBackendStubTests.scala b/core/src/test/scala/sttp/client3/testing/SttpBackendStubTests.scala similarity index 99% rename from core/src/test/scala/sttp/client/testing/SttpBackendStubTests.scala rename to core/src/test/scala/sttp/client3/testing/SttpBackendStubTests.scala index 2308124676..a7afc7d612 100644 --- a/core/src/test/scala/sttp/client/testing/SttpBackendStubTests.scala +++ b/core/src/test/scala/sttp/client3/testing/SttpBackendStubTests.scala @@ -1,4 +1,4 @@ -package sttp.client.testing +package sttp.client3.testing import java.io.ByteArrayInputStream import java.util.concurrent.TimeoutException @@ -7,9 +7,9 @@ import org.scalatest.concurrent.ScalaFutures import org.scalatest.flatspec.AnyFlatSpec import org.scalatest.matchers.should.Matchers import sttp.capabilities.{Streams, WebSockets} -import sttp.client._ -import sttp.client.internal._ -import sttp.client.monad.IdMonad +import sttp.client3._ +import sttp.client3.internal._ +import sttp.client3.monad.IdMonad import sttp.model._ import sttp.monad.{FutureMonad, TryMonad} import sttp.ws.WebSocketFrame diff --git a/core/src/test/scala/sttp/client/testing/ToFutureWrapper.scala b/core/src/test/scala/sttp/client3/testing/ToFutureWrapper.scala similarity index 93% rename from core/src/test/scala/sttp/client/testing/ToFutureWrapper.scala rename to core/src/test/scala/sttp/client3/testing/ToFutureWrapper.scala index fc0c28d8cd..9eee968bc6 100644 --- a/core/src/test/scala/sttp/client/testing/ToFutureWrapper.scala +++ b/core/src/test/scala/sttp/client3/testing/ToFutureWrapper.scala @@ -1,4 +1,4 @@ -package sttp.client.testing +package sttp.client3.testing import scala.concurrent.Future diff --git a/core/src/test/scala/sttp/client/testing/streaming/StreamingTest.scala b/core/src/test/scala/sttp/client3/testing/streaming/StreamingTest.scala similarity index 96% rename from core/src/test/scala/sttp/client/testing/streaming/StreamingTest.scala rename to core/src/test/scala/sttp/client3/testing/streaming/StreamingTest.scala index 00330db80e..e0aa027d1f 100644 --- a/core/src/test/scala/sttp/client/testing/streaming/StreamingTest.scala +++ b/core/src/test/scala/sttp/client3/testing/streaming/StreamingTest.scala @@ -1,14 +1,14 @@ -package sttp.client.testing.streaming +package sttp.client3.testing.streaming -import sttp.client._ -import sttp.client.testing.{ConvertToFuture, ToFutureWrapper} +import sttp.client3._ +import sttp.client3.testing.{ConvertToFuture, ToFutureWrapper} import org.scalatest.{BeforeAndAfterAll, SuiteMixin} import org.scalatest.freespec.AsyncFreeSpecLike import StreamingTest._ -import sttp.client.internal.Utf8 +import sttp.client3.internal.Utf8 import org.scalatest.matchers.should.Matchers import sttp.capabilities.{Effect, Streams} -import sttp.client.testing.HttpTest.endpoint +import sttp.client3.testing.HttpTest.endpoint // TODO: change to `extends AsyncFreeSpec` when https://github.com/scalatest/scalatest/issues/1802 is fixed abstract class StreamingTest[F[_], S] diff --git a/core/src/test/scalajs/sttp/client/testing/streaming/StreamingTestExtensions.scala b/core/src/test/scalajs/sttp/client/testing/streaming/StreamingTestExtensions.scala deleted file mode 100644 index 83987f38f1..0000000000 --- a/core/src/test/scalajs/sttp/client/testing/streaming/StreamingTestExtensions.scala +++ /dev/null @@ -1,7 +0,0 @@ -package sttp.client.testing.streaming - -import scala.language.higherKinds -import sttp.client.testing.AsyncExecutionContext -import sttp.client.testing.AsyncExecutionContext - -trait StreamingTestExtensions[F[_], S] extends AsyncExecutionContext { self: StreamingTest[F, S] => } diff --git a/core/src/test/scalajs/sttp/client/FetchHttpTest.scala b/core/src/test/scalajs/sttp/client3/FetchHttpTest.scala similarity index 78% rename from core/src/test/scalajs/sttp/client/FetchHttpTest.scala rename to core/src/test/scalajs/sttp/client3/FetchHttpTest.scala index 16b8e6adc4..56a7ef1cc0 100644 --- a/core/src/test/scalajs/sttp/client/FetchHttpTest.scala +++ b/core/src/test/scalajs/sttp/client3/FetchHttpTest.scala @@ -1,6 +1,6 @@ -package sttp.client +package sttp.client3 -import sttp.client.testing.{AbstractFetchHttpTest, ConvertToFuture} +import sttp.client3.testing.{AbstractFetchHttpTest, ConvertToFuture} import scala.concurrent.Future diff --git a/core/src/test/scalajs/sttp/client/testing/AbstractFetchHttpTest.scala b/core/src/test/scalajs/sttp/client3/testing/AbstractFetchHttpTest.scala similarity index 94% rename from core/src/test/scalajs/sttp/client/testing/AbstractFetchHttpTest.scala rename to core/src/test/scalajs/sttp/client3/testing/AbstractFetchHttpTest.scala index 8e7f93fc25..f8c4e985a3 100644 --- a/core/src/test/scalajs/sttp/client/testing/AbstractFetchHttpTest.scala +++ b/core/src/test/scalajs/sttp/client3/testing/AbstractFetchHttpTest.scala @@ -1,7 +1,7 @@ -package sttp.client.testing +package sttp.client3.testing import org.scalatest.compatible.Assertion -import sttp.client.Response +import sttp.client3.Response import scala.concurrent.Future import scala.language.higherKinds diff --git a/core/src/test/scalajs/sttp/client/testing/AsyncExecutionContext.scala b/core/src/test/scalajs/sttp/client3/testing/AsyncExecutionContext.scala similarity index 95% rename from core/src/test/scalajs/sttp/client/testing/AsyncExecutionContext.scala rename to core/src/test/scalajs/sttp/client3/testing/AsyncExecutionContext.scala index f535398c97..5680ea49e7 100644 --- a/core/src/test/scalajs/sttp/client/testing/AsyncExecutionContext.scala +++ b/core/src/test/scalajs/sttp/client3/testing/AsyncExecutionContext.scala @@ -1,4 +1,4 @@ -package sttp.client.testing +package sttp.client3.testing import org.scalatest.AsyncTestSuite diff --git a/core/src/test/scalajs/sttp/client/testing/HttpTestExtensions.scala b/core/src/test/scalajs/sttp/client3/testing/HttpTestExtensions.scala similarity index 94% rename from core/src/test/scalajs/sttp/client/testing/HttpTestExtensions.scala rename to core/src/test/scalajs/sttp/client3/testing/HttpTestExtensions.scala index 10380a84e1..aa8cf06e1f 100644 --- a/core/src/test/scalajs/sttp/client/testing/HttpTestExtensions.scala +++ b/core/src/test/scalajs/sttp/client3/testing/HttpTestExtensions.scala @@ -1,10 +1,10 @@ -package sttp.client.testing +package sttp.client3.testing import org.scalajs.dom.FileReader import org.scalajs.dom.raw.{Event, UIEvent} -import sttp.client._ -import sttp.client.dom.experimental.{FilePropertyBag, File => DomFile} -import sttp.client.internal.SparkMD5 +import sttp.client3._ +import sttp.client3.dom.experimental.{FilePropertyBag, File => DomFile} +import sttp.client3.internal.SparkMD5 import scala.concurrent.{Future, Promise} import scala.language.higherKinds diff --git a/core/src/test/scalajs/sttp/client/testing/Platform.scala b/core/src/test/scalajs/sttp/client3/testing/Platform.scala similarity index 92% rename from core/src/test/scalajs/sttp/client/testing/Platform.scala rename to core/src/test/scalajs/sttp/client3/testing/Platform.scala index e8b2e24f78..77d9d0077c 100644 --- a/core/src/test/scalajs/sttp/client/testing/Platform.scala +++ b/core/src/test/scalajs/sttp/client3/testing/Platform.scala @@ -1,4 +1,4 @@ -package sttp.client.testing +package sttp.client3.testing import scala.concurrent.Future import scala.concurrent.Promise diff --git a/core/src/test/scalajs/sttp/client3/testing/streaming/StreamingTestExtensions.scala b/core/src/test/scalajs/sttp/client3/testing/streaming/StreamingTestExtensions.scala new file mode 100644 index 0000000000..a219fd14aa --- /dev/null +++ b/core/src/test/scalajs/sttp/client3/testing/streaming/StreamingTestExtensions.scala @@ -0,0 +1,7 @@ +package sttp.client3.testing.streaming + +import scala.language.higherKinds +import sttp.client3.testing.AsyncExecutionContext +import sttp.client3.testing.AsyncExecutionContext + +trait StreamingTestExtensions[F[_], S] extends AsyncExecutionContext { self: StreamingTest[F, S] => } diff --git a/core/src/test/scalajvm/sttp/client/CookieRequestTests.scala b/core/src/test/scalajvm/sttp/client3/CookieRequestTests.scala similarity index 98% rename from core/src/test/scalajvm/sttp/client/CookieRequestTests.scala rename to core/src/test/scalajvm/sttp/client3/CookieRequestTests.scala index 50d6c925dc..5a3021d322 100644 --- a/core/src/test/scalajvm/sttp/client/CookieRequestTests.scala +++ b/core/src/test/scalajvm/sttp/client3/CookieRequestTests.scala @@ -1,4 +1,4 @@ -package sttp.client +package sttp.client3 import sttp.model.{StatusCode, _} import org.scalatest.flatspec.AnyFlatSpec diff --git a/core/src/test/scalajvm/sttp/client/HttpURLConnectionBackendHttpTest.scala b/core/src/test/scalajvm/sttp/client3/HttpURLConnectionBackendHttpTest.scala similarity index 85% rename from core/src/test/scalajvm/sttp/client/HttpURLConnectionBackendHttpTest.scala rename to core/src/test/scalajvm/sttp/client3/HttpURLConnectionBackendHttpTest.scala index e0f711c22e..be363f15b6 100644 --- a/core/src/test/scalajvm/sttp/client/HttpURLConnectionBackendHttpTest.scala +++ b/core/src/test/scalajvm/sttp/client3/HttpURLConnectionBackendHttpTest.scala @@ -1,8 +1,8 @@ -package sttp.client +package sttp.client3 import java.io.ByteArrayInputStream -import sttp.client.testing.{ConvertToFuture, HttpTest} +import sttp.client3.testing.{ConvertToFuture, HttpTest} class HttpURLConnectionBackendHttpTest extends HttpTest[Identity] { override val backend: SttpBackend[Identity, Any] = HttpURLConnectionBackend( diff --git a/core/src/test/scalajvm/sttp/client/ToCurlConverterTestExtension.scala b/core/src/test/scalajvm/sttp/client3/ToCurlConverterTestExtension.scala similarity index 89% rename from core/src/test/scalajvm/sttp/client/ToCurlConverterTestExtension.scala rename to core/src/test/scalajvm/sttp/client3/ToCurlConverterTestExtension.scala index 746351aa51..bc735a6ee4 100644 --- a/core/src/test/scalajvm/sttp/client/ToCurlConverterTestExtension.scala +++ b/core/src/test/scalajvm/sttp/client3/ToCurlConverterTestExtension.scala @@ -1,9 +1,9 @@ -package sttp.client +package sttp.client3 import java.io.File import org.scalatest.Suite -import sttp.client.internal.SttpFile +import sttp.client3.internal.SttpFile import org.scalatest.flatspec.AnyFlatSpec import org.scalatest.matchers.should.Matchers diff --git a/core/src/test/scalajvm/sttp/client/TryHttpURLConnectionHttpTest.scala b/core/src/test/scalajvm/sttp/client3/TryHttpURLConnectionHttpTest.scala similarity index 71% rename from core/src/test/scalajvm/sttp/client/TryHttpURLConnectionHttpTest.scala rename to core/src/test/scalajvm/sttp/client3/TryHttpURLConnectionHttpTest.scala index f1e3d94f7b..99dd4f63da 100644 --- a/core/src/test/scalajvm/sttp/client/TryHttpURLConnectionHttpTest.scala +++ b/core/src/test/scalajvm/sttp/client3/TryHttpURLConnectionHttpTest.scala @@ -1,9 +1,9 @@ -package sttp.client +package sttp.client3 import scala.util.Try -import sttp.client.testing.ConvertToFuture -import sttp.client.testing.HttpTest +import sttp.client3.testing.ConvertToFuture +import sttp.client3.testing.HttpTest class TryHttpURLConnectionHttpTest extends HttpTest[Try] { diff --git a/core/src/test/scalajvm/sttp/client/testing/HttpTestExtensions.scala b/core/src/test/scalajvm/sttp/client3/testing/HttpTestExtensions.scala similarity index 99% rename from core/src/test/scalajvm/sttp/client/testing/HttpTestExtensions.scala rename to core/src/test/scalajvm/sttp/client3/testing/HttpTestExtensions.scala index 57a92b3741..e1f22fa680 100644 --- a/core/src/test/scalajvm/sttp/client/testing/HttpTestExtensions.scala +++ b/core/src/test/scalajvm/sttp/client3/testing/HttpTestExtensions.scala @@ -1,11 +1,11 @@ -package sttp.client.testing +package sttp.client3.testing import java.io.File import java.nio.file.Files import java.security.MessageDigest import java.time.{ZoneId, ZonedDateTime} -import sttp.client._ +import sttp.client3._ import sttp.model.{CookieWithMeta, Header, HeaderNames, StatusCode} import scala.concurrent.Future diff --git a/core/src/test/scalajvm/sttp/client/testing/Platform.scala b/core/src/test/scalajvm/sttp/client3/testing/Platform.scala similarity index 91% rename from core/src/test/scalajvm/sttp/client/testing/Platform.scala rename to core/src/test/scalajvm/sttp/client3/testing/Platform.scala index 14a69a5c56..72120d0cfb 100644 --- a/core/src/test/scalajvm/sttp/client/testing/Platform.scala +++ b/core/src/test/scalajvm/sttp/client3/testing/Platform.scala @@ -1,4 +1,4 @@ -package sttp.client.testing +package sttp.client3.testing import scala.concurrent.ExecutionContext import scala.concurrent.Future diff --git a/core/src/test/scalajvm/sttp/client/testing/streaming/StreamingTestExtensions.scala b/core/src/test/scalajvm/sttp/client3/testing/streaming/StreamingTestExtensions.scala similarity index 65% rename from core/src/test/scalajvm/sttp/client/testing/streaming/StreamingTestExtensions.scala rename to core/src/test/scalajvm/sttp/client3/testing/streaming/StreamingTestExtensions.scala index c9f103b048..90dccd3077 100644 --- a/core/src/test/scalajvm/sttp/client/testing/streaming/StreamingTestExtensions.scala +++ b/core/src/test/scalajvm/sttp/client3/testing/streaming/StreamingTestExtensions.scala @@ -1,3 +1,3 @@ -package sttp.client.testing.streaming +package sttp.client3.testing.streaming trait StreamingTestExtensions[F[_], S] { self: StreamingTest[F, S] => } diff --git a/core/src/test/scalajvm/sttp/client/testing/websocket/WebSocketBufferOverflowTest.scala b/core/src/test/scalajvm/sttp/client3/testing/websocket/WebSocketBufferOverflowTest.scala similarity index 88% rename from core/src/test/scalajvm/sttp/client/testing/websocket/WebSocketBufferOverflowTest.scala rename to core/src/test/scalajvm/sttp/client3/testing/websocket/WebSocketBufferOverflowTest.scala index 9a25d34044..1e90c95b9c 100644 --- a/core/src/test/scalajvm/sttp/client/testing/websocket/WebSocketBufferOverflowTest.scala +++ b/core/src/test/scalajvm/sttp/client3/testing/websocket/WebSocketBufferOverflowTest.scala @@ -1,14 +1,14 @@ -package sttp.client.testing.websocket +package sttp.client3.testing.websocket import java.nio.channels.ClosedChannelException import org.scalatest.Suite import org.scalatest.flatspec.AsyncFlatSpecLike import sttp.capabilities.WebSockets -import sttp.client.testing.HttpTest.wsEndpoint -import sttp.client._ +import sttp.client3.testing.HttpTest.wsEndpoint +import sttp.client3._ import sttp.monad.MonadError -import sttp.client.testing.ConvertToFuture +import sttp.client3.testing.ConvertToFuture import scala.concurrent.duration._ import scala.concurrent.duration.FiniteDuration diff --git a/core/src/test/scalajvm/sttp/client/testing/websocket/WebSocketStreamingTest.scala b/core/src/test/scalajvm/sttp/client3/testing/websocket/WebSocketStreamingTest.scala similarity index 94% rename from core/src/test/scalajvm/sttp/client/testing/websocket/WebSocketStreamingTest.scala rename to core/src/test/scalajvm/sttp/client3/testing/websocket/WebSocketStreamingTest.scala index 1e0792529e..913e033336 100644 --- a/core/src/test/scalajvm/sttp/client/testing/websocket/WebSocketStreamingTest.scala +++ b/core/src/test/scalajvm/sttp/client3/testing/websocket/WebSocketStreamingTest.scala @@ -1,4 +1,4 @@ -package sttp.client.testing.websocket +package sttp.client3.testing.websocket import java.util.concurrent.LinkedBlockingQueue import java.util.concurrent.atomic.AtomicReference @@ -9,10 +9,10 @@ import org.scalatest.flatspec.AsyncFlatSpecLike import org.scalatest.matchers.should.Matchers import sttp.capabilities.{Streams, WebSockets} import sttp.monad.MonadError -import sttp.client.testing.HttpTest.wsEndpoint -import sttp.client.testing.{ConvertToFuture, ToFutureWrapper} -import sttp.client.{SttpBackend, asWebSocketStreamAlways, basicRequest} -import sttp.client._ +import sttp.client3.testing.HttpTest.wsEndpoint +import sttp.client3.testing.{ConvertToFuture, ToFutureWrapper} +import sttp.client3.{SttpBackend, asWebSocketStreamAlways, basicRequest} +import sttp.client3._ import sttp.monad.syntax._ import sttp.ws.WebSocketFrame diff --git a/core/src/test/scalajvm/sttp/client/testing/websocket/WebSocketTest.scala b/core/src/test/scalajvm/sttp/client3/testing/websocket/WebSocketTest.scala similarity index 92% rename from core/src/test/scalajvm/sttp/client/testing/websocket/WebSocketTest.scala rename to core/src/test/scalajvm/sttp/client3/testing/websocket/WebSocketTest.scala index e26e07a2f9..67b5508068 100644 --- a/core/src/test/scalajvm/sttp/client/testing/websocket/WebSocketTest.scala +++ b/core/src/test/scalajvm/sttp/client3/testing/websocket/WebSocketTest.scala @@ -1,4 +1,4 @@ -package sttp.client.testing.websocket +package sttp.client3.testing.websocket import org.scalatest.{Assertion, BeforeAndAfterAll, SuiteMixin} import org.scalatest.concurrent.{Signaler, ThreadSignaler, TimeLimits} @@ -6,12 +6,12 @@ import org.scalatest.flatspec.AsyncFlatSpecLike import org.scalatest.matchers.should.Matchers import org.scalatest.time.{Seconds, Span} import sttp.capabilities.WebSockets -import sttp.client._ -import sttp.client.SttpClientException.ReadException +import sttp.client3._ +import sttp.client3.SttpClientException.ReadException import sttp.monad.MonadError import sttp.monad.syntax._ -import sttp.client.testing.{ConvertToFuture, ToFutureWrapper} -import sttp.client.testing.HttpTest.wsEndpoint +import sttp.client3.testing.{ConvertToFuture, ToFutureWrapper} +import sttp.client3.testing.HttpTest.wsEndpoint import sttp.ws.{WebSocket, WebSocketFrame} abstract class WebSocketTest[F[_]] @@ -101,8 +101,8 @@ abstract class WebSocketTest[F[_]] .response(asWebSocketAlwaysUnsafe[F]) .send(backend) .map(_ => fail("should not open WebSocket")) - .handleError { - case _: ReadException => monad.unit(succeed) + .handleError { case _: ReadException => + monad.unit(succeed) } .toFuture() } diff --git a/core/src/test/scalanative/sttp/client/testing/streaming/StreamingTestExtensions.scala b/core/src/test/scalanative/sttp/client/testing/streaming/StreamingTestExtensions.scala deleted file mode 100644 index 16a5c92d00..0000000000 --- a/core/src/test/scalanative/sttp/client/testing/streaming/StreamingTestExtensions.scala +++ /dev/null @@ -1,6 +0,0 @@ -package sttp.client.testing.streaming - -import sttp.client.testing.AsyncExecutionContext -import sttp.client.testing.AsyncExecutionContext - -trait StreamingTestExtensions[F[_], S] extends AsyncExecutionContext {} diff --git a/core/src/test/scalanative/sttp/client/CurlBackendHttpTest.scala b/core/src/test/scalanative/sttp/client3/CurlBackendHttpTest.scala similarity index 70% rename from core/src/test/scalanative/sttp/client/CurlBackendHttpTest.scala rename to core/src/test/scalanative/sttp/client3/CurlBackendHttpTest.scala index 8629e0cf1f..c4c10dfbb1 100644 --- a/core/src/test/scalanative/sttp/client/CurlBackendHttpTest.scala +++ b/core/src/test/scalanative/sttp/client3/CurlBackendHttpTest.scala @@ -1,6 +1,6 @@ -package sttp.client +package sttp.client3 -import sttp.client.testing.SyncHttpTest +import sttp.client3.testing.SyncHttpTest class CurlBackendHttpTest extends SyncHttpTest { override implicit lazy val backend: SttpBackend[Identity, Any] = CurlBackend(verbose = true) diff --git a/core/src/test/scalanative/sttp/client/ToCurlConverterTestExtension.scala b/core/src/test/scalanative/sttp/client3/ToCurlConverterTestExtension.scala similarity index 65% rename from core/src/test/scalanative/sttp/client/ToCurlConverterTestExtension.scala rename to core/src/test/scalanative/sttp/client3/ToCurlConverterTestExtension.scala index 8bed342af5..05a630ef7b 100644 --- a/core/src/test/scalanative/sttp/client/ToCurlConverterTestExtension.scala +++ b/core/src/test/scalanative/sttp/client3/ToCurlConverterTestExtension.scala @@ -1,3 +1,3 @@ -package sttp.client +package sttp.client3 trait ToCurlConverterTestExtension {} diff --git a/core/src/test/scalanative/sttp/client/testing/AsyncExecutionContext.scala b/core/src/test/scalanative/sttp/client3/testing/AsyncExecutionContext.scala similarity index 83% rename from core/src/test/scalanative/sttp/client/testing/AsyncExecutionContext.scala rename to core/src/test/scalanative/sttp/client3/testing/AsyncExecutionContext.scala index a4a5e0f5a9..d546dbc8aa 100644 --- a/core/src/test/scalanative/sttp/client/testing/AsyncExecutionContext.scala +++ b/core/src/test/scalanative/sttp/client3/testing/AsyncExecutionContext.scala @@ -1,4 +1,4 @@ -package sttp.client.testing +package sttp.client3.testing import scala.concurrent.ExecutionContext diff --git a/core/src/test/scalanative/sttp/client/testing/HttpTestExtensions.scala b/core/src/test/scalanative/sttp/client3/testing/HttpTestExtensions.scala similarity index 76% rename from core/src/test/scalanative/sttp/client/testing/HttpTestExtensions.scala rename to core/src/test/scalanative/sttp/client3/testing/HttpTestExtensions.scala index 26e4a9a574..fb1139f4f4 100644 --- a/core/src/test/scalanative/sttp/client/testing/HttpTestExtensions.scala +++ b/core/src/test/scalanative/sttp/client3/testing/HttpTestExtensions.scala @@ -1,4 +1,4 @@ -package sttp.client.testing +package sttp.client3.testing import scala.language.higherKinds diff --git a/core/src/test/scalanative/sttp/client/testing/Platform.scala b/core/src/test/scalanative/sttp/client3/testing/Platform.scala similarity index 90% rename from core/src/test/scalanative/sttp/client/testing/Platform.scala rename to core/src/test/scalanative/sttp/client3/testing/Platform.scala index dff641a611..c28d309d48 100644 --- a/core/src/test/scalanative/sttp/client/testing/Platform.scala +++ b/core/src/test/scalanative/sttp/client3/testing/Platform.scala @@ -1,4 +1,4 @@ -package sttp.client.testing +package sttp.client3.testing import scala.concurrent.{ExecutionContext, Future} import scala.concurrent.duration.FiniteDuration diff --git a/core/src/test/scalanative/sttp/client/testing/SyncHttpTest.scala b/core/src/test/scalanative/sttp/client3/testing/SyncHttpTest.scala similarity index 98% rename from core/src/test/scalanative/sttp/client/testing/SyncHttpTest.scala rename to core/src/test/scalanative/sttp/client3/testing/SyncHttpTest.scala index 70d1ddc3da..19c308e66f 100644 --- a/core/src/test/scalanative/sttp/client/testing/SyncHttpTest.scala +++ b/core/src/test/scalanative/sttp/client3/testing/SyncHttpTest.scala @@ -1,9 +1,9 @@ -package sttp.client.testing +package sttp.client3.testing import java.io.ByteArrayInputStream import java.nio.ByteBuffer -import sttp.client._ +import sttp.client3._ import org.scalatest._ import org.scalatest.freespec.AnyFreeSpec import sttp.model.StatusCode @@ -11,7 +11,7 @@ import org.scalatest.matchers.should.Matchers import scala.concurrent.duration._ -// This is a synchronous version of sttp.client.testing.HttpTest. +// This is a synchronous version of sttp.client3.testing.HttpTest. // It had to be copied, because there are no async test specs in scala-test. // As soon as AsyncFreeSpec is released for Scala Native, this one should be drooped in favour of HttpTest. // The progress can be tracked within this issue: https://github.com/scalatest/scalatest/issues/1112. @@ -35,7 +35,7 @@ trait SyncHttpTest protected val testBodyBytes = testBody.getBytes("UTF-8") protected val expectedPostEchoResponse = "POST /echo this is the body" - protected val sttpIgnore = sttp.client.ignore + protected val sttpIgnore = sttp.client3.ignore "parse response" - { "as string" in { diff --git a/core/src/test/scalanative/sttp/client/testing/SyncHttpTestExtensions.scala b/core/src/test/scalanative/sttp/client3/testing/SyncHttpTestExtensions.scala similarity index 98% rename from core/src/test/scalanative/sttp/client/testing/SyncHttpTestExtensions.scala rename to core/src/test/scalanative/sttp/client3/testing/SyncHttpTestExtensions.scala index cb26e7e1e2..2985e1a5a9 100644 --- a/core/src/test/scalanative/sttp/client/testing/SyncHttpTestExtensions.scala +++ b/core/src/test/scalanative/sttp/client3/testing/SyncHttpTestExtensions.scala @@ -1,10 +1,10 @@ -package sttp.client.testing +package sttp.client3.testing import java.io.File import java.nio.file.Files import java.security.MessageDigest -import sttp.client._ +import sttp.client3._ import sttp.model.StatusCode trait SyncHttpTestExtensions { diff --git a/core/src/test/scalanative/sttp/client3/testing/streaming/StreamingTestExtensions.scala b/core/src/test/scalanative/sttp/client3/testing/streaming/StreamingTestExtensions.scala new file mode 100644 index 0000000000..7b2299780c --- /dev/null +++ b/core/src/test/scalanative/sttp/client3/testing/streaming/StreamingTestExtensions.scala @@ -0,0 +1,6 @@ +package sttp.client3.testing.streaming + +import sttp.client3.testing.AsyncExecutionContext +import sttp.client3.testing.AsyncExecutionContext + +trait StreamingTestExtensions[F[_], S] extends AsyncExecutionContext {} diff --git a/docs/backends/akka.md b/docs/backends/akka.md index f3c1afa204..7520935016 100644 --- a/docs/backends/akka.md +++ b/docs/backends/akka.md @@ -3,7 +3,7 @@ This backend is based on [akka-http](http://doc.akka.io/docs/akka-http/current/scala/http/). To use, add the following dependency to your project: ``` -"com.softwaremill.sttp.client" %% "akka-http-backend" % "@VERSION@" +"com.softwaremill.sttp.client3" %% "akka-http-backend" % "@VERSION@" ``` A fully **asynchronous** backend. Uses the `Future` effect to return responses. There are also [other `Future`-based backends](future.md), which don't depend on Akka. @@ -17,27 +17,27 @@ Note that you'll also need an explicit dependency on akka-streams, as akka-http Next you'll need to add create the backend instance: ```scala mdoc:compile-only -import sttp.client.akkahttp._ +import sttp.client3.akkahttp._ val backend = AkkaHttpBackend() ``` or, if you'd like to use an existing actor system: ```scala mdoc:compile-only -import sttp.client.akkahttp._ +import sttp.client3.akkahttp._ import akka.actor.ActorSystem val actorSystem: ActorSystem = ??? val backend = AkkaHttpBackend.usingActorSystem(actorSystem) ``` -This backend supports sending and receiving [akka-streams](http://doc.akka.io/docs/akka/current/scala/stream/index.html) streams. The streams capability is represented as `sttp.client.akkahttp.AkkaStreams`. +This backend supports sending and receiving [akka-streams](http://doc.akka.io/docs/akka/current/scala/stream/index.html) streams. The streams capability is represented as `sttp.client3.akkahttp.AkkaStreams`. To set the request body as a stream: ```scala mdoc:compile-only import sttp.capabilities.akka.AkkaStreams -import sttp.client._ +import sttp.client3._ import akka.stream.scaladsl.Source import akka.util.ByteString @@ -54,8 +54,8 @@ To receive the response body as a stream: ```scala mdoc:compile-only import scala.concurrent.Future import sttp.capabilities.akka.AkkaStreams -import sttp.client._ -import sttp.client.akkahttp.AkkaHttpBackend +import sttp.client3._ +import sttp.client3.akkahttp.AkkaHttpBackend import akka.stream.scaladsl.Source import akka.util.ByteString @@ -80,7 +80,7 @@ That way, you can "mock" a server that the backend will talk to, without startin If your application provides a client library for its dependants to use, this is a great way to ensure that the client actually matches the routes exposed by your application: ```scala mdoc:compile-only -import sttp.client.akkahttp._ +import sttp.client3.akkahttp._ import akka.http.scaladsl.server.Route import akka.actor.ActorSystem diff --git a/docs/backends/catseffect.md b/docs/backends/catseffect.md index ad744a41c0..c6e005689f 100644 --- a/docs/backends/catseffect.md +++ b/docs/backends/catseffect.md @@ -5,14 +5,14 @@ The [Cats Effect](https://github.com/typelevel/cats-effect) backend is **asynchr To use, add the following dependency to your project: ```scala -"com.softwaremill.sttp.client" %% "async-http-client-backend-cats" % "@VERSION@" +"com.softwaremill.sttp.client3" %% "async-http-client-backend-cats" % "@VERSION@" ``` You'll need the following imports and implicits to create the backend: ```scala mdoc:silent -import sttp.client._ -import sttp.client.asynchttpclient.cats.AsyncHttpClientCatsBackend +import sttp.client3._ +import sttp.client3.asynchttpclient.cats.AsyncHttpClientCatsBackend import cats.effect._ // an implicit `cats.effect.ContextShift` in required to create the backend; here, for `cats.effect.IO`: diff --git a/docs/backends/finagle.md b/docs/backends/finagle.md index 9f866f2a8c..e4579d8e5f 100644 --- a/docs/backends/finagle.md +++ b/docs/backends/finagle.md @@ -3,13 +3,13 @@ To use, add the following dependency to your project: ``` -"com.softwaremill.sttp.client" %% "finagle-backend" % "@VERSION@" +"com.softwaremill.sttp.client3" %% "finagle-backend" % "@VERSION@" ``` Next you'll need to add an implicit value: ```scala -import sttp.client.finagle.FinagleBackend +import sttp.client3.finagle.FinagleBackend val backend = FinagleBackend() ``` diff --git a/docs/backends/fs2.md b/docs/backends/fs2.md index 85a072fe01..bd79eab1ed 100644 --- a/docs/backends/fs2.md +++ b/docs/backends/fs2.md @@ -7,15 +7,15 @@ The [fs2](https://github.com/functional-streams-for-scala/fs2) backend is **asyn To use, add the following dependency to your project: ```scala -"com.softwaremill.sttp.client" %% "async-http-client-backend-fs2" % "@VERSION@" +"com.softwaremill.sttp.client3" %% "async-http-client-backend-fs2" % "@VERSION@" ``` And some imports: ```scala mdoc:silent -import sttp.client.asynchttpclient.fs2.AsyncHttpClientFs2Backend +import sttp.client3.asynchttpclient.fs2.AsyncHttpClientFs2Backend import cats.effect._ -import sttp.client._ +import sttp.client3._ // an implicit `cats.effect.ContextShift` is required to create a concurrent instance for `cats.effect.IO`, // as well as a `cats.effect.Blocker` instance. Note that you'll probably want to use a different thread @@ -76,15 +76,15 @@ val backend = AsyncHttpClientFs2Backend.usingClient[IO](asyncHttpClient, blocker To use, add the following dependency to your project: ``` -"com.softwaremill.sttp.client" %% "httpclient-backend-fs2" % "@VERSION@" +"com.softwaremill.sttp.client3" %% "httpclient-backend-fs2" % "@VERSION@" ``` And some imports: ```scala mdoc:reset:silent -import sttp.client.httpclient.fs2.HttpClientFs2Backend +import sttp.client3.httpclient.fs2.HttpClientFs2Backend import cats.effect._ -import sttp.client._ +import sttp.client3._ // an implicit `cats.effect.ContextShift` is required to create a concurrent instance for `cats.effect.IO`, // as well as a `cats.effect.Blocker` instance. Note that you'll probably want to use a different thread @@ -96,7 +96,7 @@ val blocker = Blocker.liftExecutionContext(scala.concurrent.ExecutionContext.glo Create the backend using: ```scala mdoc:compile-only -import sttp.client.httpclient.fs2.HttpClientFs2Backend +import sttp.client3.httpclient.fs2.HttpClientFs2Backend HttpClientFs2Backend[IO](blocker).flatMap { backend => ??? } ``` @@ -118,14 +118,14 @@ This backend is based on the built-in `java.net.http.HttpClient` available from ## Streaming -The fs2 backend supports streaming for any instance of the `cats.effect.Effect` typeclass, such as `cats.effect.IO`. If `IO` is used then the type of supported streams is `fs2.Stream[IO, Byte]`. The streams capability is represented as `sttp.client.fs2.Fs2Streams`. +The fs2 backend supports streaming for any instance of the `cats.effect.Effect` typeclass, such as `cats.effect.IO`. If `IO` is used then the type of supported streams is `fs2.Stream[IO, Byte]`. The streams capability is represented as `sttp.client3.fs2.Fs2Streams`. Requests can be sent with a streaming body like this: ```scala mdoc:compile-only import sttp.capabilities.fs2.Fs2Streams -import sttp.client._ -import sttp.client.asynchttpclient.fs2.AsyncHttpClientFs2Backend +import sttp.client3._ +import sttp.client3.asynchttpclient.fs2.AsyncHttpClientFs2Backend import fs2.Stream val effect = AsyncHttpClientFs2Backend[IO](blocker).flatMap { backend => @@ -143,7 +143,7 @@ Responses can also be streamed: ```scala mdoc:compile-only import sttp.capabilities.fs2.Fs2Streams -import sttp.client.asynchttpclient.fs2.AsyncHttpClientFs2Backend +import sttp.client3.asynchttpclient.fs2.AsyncHttpClientFs2Backend import fs2.Stream import scala.concurrent.duration.Duration diff --git a/docs/backends/future.md b/docs/backends/future.md index 2fa78412cd..cd57d7d88c 100644 --- a/docs/backends/future.md +++ b/docs/backends/future.md @@ -20,14 +20,14 @@ Class Supported stream type To use, add the following dependency to your project: ```scala -"com.softwaremill.sttp.client" %% "async-http-client-backend-future" % "@VERSION@" +"com.softwaremill.sttp.client3" %% "async-http-client-backend-future" % "@VERSION@" ``` And some imports: ```scala mdoc -import sttp.client._ -import sttp.client.asynchttpclient.future.AsyncHttpClientFutureBackend +import sttp.client3._ +import sttp.client3.asynchttpclient.future.AsyncHttpClientFutureBackend ``` This backend depends on [async-http-client](https://github.com/AsyncHttpClient/async-http-client) and uses [Netty](http://netty.io) behind the scenes. @@ -71,13 +71,13 @@ val backend = AsyncHttpClientFutureBackend.usingClient(asyncHttpClient) To use, add the following dependency to your project: ```scala -"com.softwaremill.sttp.client" %% "okhttp-backend" % "@VERSION@" +"com.softwaremill.sttp.client3" %% "okhttp-backend" % "@VERSION@" ``` and some imports: ```scala mdoc:reset:silent -import sttp.client.okhttp.OkHttpFutureBackend +import sttp.client3.okhttp.OkHttpFutureBackend import scala.concurrent.ExecutionContext.Implicits.global ``` @@ -103,13 +103,13 @@ This backend depends on [OkHttp](http://square.github.io/okhttp/) and fully supp To use, add the following dependency to your project: ``` -"com.softwaremill.sttp.client" %% "httpclient-backend" % "@VERSION@" +"com.softwaremill.sttp.client3" %% "httpclient-backend" % "@VERSION@" ``` and some imports: ```scala mdoc:reset:silent -import sttp.client.httpclient.HttpClientFutureBackend +import sttp.client3.httpclient.HttpClientFutureBackend import scala.concurrent.ExecutionContext.Implicits.global ``` diff --git a/docs/backends/http4s.md b/docs/backends/http4s.md index 5bf603a31c..84ec69d3a8 100644 --- a/docs/backends/http4s.md +++ b/docs/backends/http4s.md @@ -3,14 +3,14 @@ This backend is based on [http4s](https://http4s.org) (blaze client) and is **asynchronous**. To use, add the following dependency to your project: ``` -"com.softwaremill.sttp.client" %% "http4s-backend" % "@VERSION@" +"com.softwaremill.sttp.client3" %% "http4s-backend" % "@VERSION@" ``` Add some imports as well: ```scala mdoc:silent import cats.effect._ -import sttp.client.http4s._ +import sttp.client3.http4s._ import scala.concurrent._ // an implicit `cats.effect.ContextShift` is required to create an instance of `cats.effect.Concurrent` diff --git a/docs/backends/javascript/fetch.md b/docs/backends/javascript/fetch.md index c065f30538..bcfff88590 100644 --- a/docs/backends/javascript/fetch.md +++ b/docs/backends/javascript/fetch.md @@ -5,7 +5,7 @@ A JavaScript backend implemented using the [Fetch API](https://developer.mozilla This is the default backend, available in the main jar for JS. To use, add the following dependency to your project: ``` -"com.softwaremill.sttp.client" %%% "core" % "@VERSION@" +"com.softwaremill.sttp.client3" %%% "core" % "@VERSION@" ``` And create the backend instance: @@ -48,14 +48,14 @@ Streaming support is provided via `FetchMonixBackend`. Note that streaming suppo To use, add the following dependency to your project: ``` -"com.softwaremill.sttp.client" %%% "monix" % "@VERSION@" +"com.softwaremill.sttp.client3" %%% "monix" % "@VERSION@" ``` An example of streaming a response: ```scala -import sttp.client._ -import sttp.client.impl.monix._ +import sttp.client3._ +import sttp.client3.impl.monix._ import java.nio.ByteBuffer import monix.eval.Task diff --git a/docs/backends/monix.md b/docs/backends/monix.md index 5acf5f0437..18417cff12 100644 --- a/docs/backends/monix.md +++ b/docs/backends/monix.md @@ -7,7 +7,7 @@ There are several backend implementations which are `monix.eval.Task`-based. The To use, add the following dependency to your project: ```scala -"com.softwaremill.sttp.client" %% "async-http-client-backend-monix" % "@VERSION@" +"com.softwaremill.sttp.client3" %% "async-http-client-backend-monix" % "@VERSION@" ``` This backend depends on [async-http-client](https://github.com/AsyncHttpClient/async-http-client), uses [Netty](http://netty.io) behind the scenes and supports effect cancellation. @@ -20,8 +20,8 @@ Next you'll need to define a backend instance as an implicit value. This can be A non-comprehensive summary of how the backend can be created is as follows: ```scala mdoc:compile-only -import sttp.client.asynchttpclient.monix.AsyncHttpClientMonixBackend -import sttp.client._ +import sttp.client3.asynchttpclient.monix.AsyncHttpClientMonixBackend +import sttp.client3._ AsyncHttpClientMonixBackend().flatMap { backend => ??? } @@ -50,13 +50,13 @@ val backend = AsyncHttpClientMonixBackend.usingClient(asyncHttpClient) To use, add the following dependency to your project: ```scala -"com.softwaremill.sttp.client" %% "okhttp-backend-monix" % "@VERSION@" +"com.softwaremill.sttp.client3" %% "okhttp-backend-monix" % "@VERSION@" ``` Create the backend using: ```scala mdoc:compile-only -import sttp.client.okhttp.monix.OkHttpMonixBackend +import sttp.client3.okhttp.monix.OkHttpMonixBackend OkHttpMonixBackend().flatMap { backend => ??? } @@ -76,13 +76,13 @@ This backend depends on [OkHttp](http://square.github.io/okhttp/) and fully supp To use, add the following dependency to your project: ``` -"com.softwaremill.sttp.client" %% "httpclient-backend-monix" % "@VERSION@" +"com.softwaremill.sttp.client3" %% "httpclient-backend-monix" % "@VERSION@" ``` Create the backend using: ```scala mdoc:compile-only -import sttp.client.httpclient.monix.HttpClientMonixBackend +import sttp.client3.httpclient.monix.HttpClientMonixBackend HttpClientMonixBackend().flatMap { backend => ??? } @@ -99,12 +99,12 @@ This backend is based on the built-in `java.net.http.HttpClient` available from ## Streaming -The Monix backends support streaming. The streams capability is represented as `sttp.client.impl.monix.MonixStreams`. The type of supported streams in this case is `Observable[ByteBuffer]`. That is, you can set such an observable as a request body (using the async-http-client backend as an example, but any of the above backends can be used): +The Monix backends support streaming. The streams capability is represented as `sttp.client3.impl.monix.MonixStreams`. The type of supported streams in this case is `Observable[ByteBuffer]`. That is, you can set such an observable as a request body (using the async-http-client backend as an example, but any of the above backends can be used): ```scala mdoc:compile-only import sttp.capabilities.monix.MonixStreams -import sttp.client._ -import sttp.client.asynchttpclient.monix._ +import sttp.client3._ +import sttp.client3.asynchttpclient.monix._ import java.nio.ByteBuffer import monix.reactive.Observable @@ -123,8 +123,8 @@ And receive responses as an observable stream: ```scala mdoc:compile-only import sttp.capabilities.monix.MonixStreams -import sttp.client._ -import sttp.client.asynchttpclient.monix._ +import sttp.client3._ +import sttp.client3.asynchttpclient.monix._ import java.nio.ByteBuffer import monix.eval.Task diff --git a/docs/backends/native/curl.md b/docs/backends/native/curl.md index f4aeeca2a3..ac17e761f0 100644 --- a/docs/backends/native/curl.md +++ b/docs/backends/native/curl.md @@ -5,7 +5,7 @@ A Scala Native backend implemented using [Curl](https://github.com/curl/curl/blo To use, add the following dependency to your project: ``` -"com.softwaremill.sttp.client" %%% "core" % "@VERSION@" +"com.softwaremill.sttp.client3" %%% "core" % "@VERSION@" ``` and initialize one of the backends: diff --git a/docs/backends/scalaz.md b/docs/backends/scalaz.md index 1279ab8160..04c326158c 100644 --- a/docs/backends/scalaz.md +++ b/docs/backends/scalaz.md @@ -5,7 +5,7 @@ The [Scalaz](https://github.com/scalaz/scalaz) backend is **asynchronous**. Send To use, add the following dependency to your project: ```scala -"com.softwaremill.sttp.client" %% "async-http-client-backend-scalaz" % "@VERSION@" +"com.softwaremill.sttp.client3" %% "async-http-client-backend-scalaz" % "@VERSION@" ``` This backend depends on [async-http-client](https://github.com/AsyncHttpClient/async-http-client) and uses [Netty](http://netty.io) behind the scenes. @@ -13,8 +13,8 @@ This backend depends on [async-http-client](https://github.com/AsyncHttpClient/a Next you'll need to add an implicit value: ```scala mdoc:compile-only -import sttp.client._ -import sttp.client.asynchttpclient.scalaz.AsyncHttpClientScalazBackend +import sttp.client3._ +import sttp.client3.asynchttpclient.scalaz.AsyncHttpClientScalazBackend AsyncHttpClientScalazBackend().flatMap { backend => ??? } diff --git a/docs/backends/synchronous.md b/docs/backends/synchronous.md index acd7951555..356ae0ffff 100644 --- a/docs/backends/synchronous.md +++ b/docs/backends/synchronous.md @@ -1,6 +1,6 @@ # Synchronous backends -There are several synchronous backend implementations. Sending a request using these backends is a blocking operation, and results in a `sttp.client.Response[T]`. +There are several synchronous backend implementations. Sending a request using these backends is a blocking operation, and results in a `sttp.client3.Response[T]`. ## Using HttpURLConnection @@ -9,7 +9,7 @@ The default **synchronous** backend, available in the main jar for the JVM. To use, add an implicit value: ```scala mdoc:compile-only -import sttp.client._ +import sttp.client3._ val backend = HttpURLConnectionBackend() ``` @@ -20,13 +20,13 @@ This backend works with all Scala versions. A Dotty build is available as well. To use, add the following dependency to your project: ``` -"com.softwaremill.sttp.client" %% "okhttp-backend" % "@VERSION@" +"com.softwaremill.sttp.client3" %% "okhttp-backend" % "@VERSION@" ``` Create the backend using: ```scala mdoc:compile-only -import sttp.client.okhttp.OkHttpSyncBackend +import sttp.client3.okhttp.OkHttpSyncBackend val backend = OkHttpSyncBackend() ``` @@ -34,7 +34,7 @@ val backend = OkHttpSyncBackend() or, if you'd like to instantiate the OkHttpClient yourself: ```scala mdoc:compile-only -import sttp.client.okhttp.OkHttpSyncBackend +import sttp.client3.okhttp.OkHttpSyncBackend import okhttp3._ val okHttpClient: OkHttpClient = ??? @@ -48,13 +48,13 @@ This backend depends on [OkHttp](http://square.github.io/okhttp/) and fully supp To use, add the following dependency to your project: ``` -"com.softwaremill.sttp.client" %% "httpclient-backend" % "@VERSION@" +"com.softwaremill.sttp.client3" %% "httpclient-backend" % "@VERSION@" ``` Create the backend using: ```scala mdoc:compile-only -import sttp.client.httpclient.HttpClientSyncBackend +import sttp.client3.httpclient.HttpClientSyncBackend val backend = HttpClientSyncBackend() ``` @@ -62,7 +62,7 @@ val backend = HttpClientSyncBackend() or, if you'd like to instantiate the HttpClient yourself: ```scala mdoc:compile-only -import sttp.client.httpclient.HttpClientSyncBackend +import sttp.client3.httpclient.HttpClientSyncBackend import java.net.http.HttpClient val httpClient: HttpClient = ??? val backend = HttpClientSyncBackend.usingClient(httpClient) diff --git a/docs/backends/wrappers/custom.md b/docs/backends/wrappers/custom.md index 32020eee6a..6707c39146 100644 --- a/docs/backends/wrappers/custom.md +++ b/docs/backends/wrappers/custom.md @@ -20,7 +20,7 @@ Backends, or backend wrappers can use tags e.g. for logging, passing a metric na ## Listener backend -The `sttp.client.listener.ListenerBackend` can make it easier to create backend wrappers which need to be notified about request lifecycle events: when a request is started, and when it completes either successfully or with an exception. This is possible by implementing a `sttp.client.listener.RequestListener`. This is how e.g. the [slf4j backend](logging.md) is implemented. +The `sttp.client3.listener.ListenerBackend` can make it easier to create backend wrappers which need to be notified about request lifecycle events: when a request is started, and when it completes either successfully or with an exception. This is possible by implementing a `sttp.client3.listener.RequestListener`. This is how e.g. the [slf4j backend](logging.md) is implemented. A request listener can associate a value with a request, which will then be passed to the request completion notification methods. @@ -36,7 +36,7 @@ For example: ```scala mdoc:compile-only import sttp.capabilities.Effect -import sttp.client._ +import sttp.client3._ import sttp.monad.MonadError class MyWrapper[F[_], P] private (delegate: SttpBackend[F, P]) @@ -71,9 +71,9 @@ metrics for completed requests and wraps any `Future`-based backend: ```scala mdoc:compile-only import sttp.capabilities.Effect -import sttp.client._ +import sttp.client3._ import sttp.monad.MonadError -import sttp.client.akkahttp._ +import sttp.client3.akkahttp._ import scala.concurrent.Future import scala.concurrent.ExecutionContext.Implicits.global import scala.util._ @@ -138,7 +138,7 @@ In some cases it's possible to implement a generic retry mechanism; such a mecha ```scala mdoc:compile-only import sttp.capabilities.Effect -import sttp.client._ +import sttp.client3._ import sttp.monad.MonadError class RetryingBackend[F[_], P]( @@ -185,7 +185,7 @@ Below is an example on how to implement a backend wrapper, which integrates with ```scala mdoc:compile-only import io.github.resilience4j.circuitbreaker.{CallNotPermittedException, CircuitBreaker} import sttp.capabilities.Effect -import sttp.client.{Request, Response, SttpBackend} +import sttp.client3.{Request, Response, SttpBackend} import sttp.monad.MonadError import java.util.concurrent.TimeUnit @@ -245,7 +245,7 @@ Below is an example on how to implement a backend wrapper, which integrates with import io.github.resilience4j.ratelimiter.RateLimiter import sttp.capabilities.Effect import sttp.monad.MonadError -import sttp.client.{Request, Response, SttpBackend} +import sttp.client3.{Request, Response, SttpBackend} class RateLimitingSttpBackend[F[_], P]( rateLimiter: RateLimiter, @@ -285,14 +285,14 @@ object RateLimitingSttpBackend { Implementing a new backend is made easy as the tests are published in the `core` jar file under the `tests` classifier. Simply add the follow dependencies to your `build.sbt`: ``` -"com.softwaremill.sttp.client" %% "core" % "@VERSION@" % Test classifier "tests" +"com.softwaremill.sttp.client3" %% "core" % "@VERSION@" % Test classifier "tests" ``` Implement your backend and extend the `HttpTest` class: ```scala mdoc:compile-only -import sttp.client._ -import sttp.client.testing.{ConvertToFuture, HttpTest} +import sttp.client3._ +import sttp.client3.testing.{ConvertToFuture, HttpTest} import scala.concurrent.Future class MyCustomBackendHttpTest extends HttpTest[Future] { @@ -308,7 +308,7 @@ You can find a more detailed example in the [sttp-vertx](https://github.com/guym When implementing a backend wrapper using cats, it might be useful to import: ```scala -import sttp.client.impl.cats.implicits._ +import sttp.client3.impl.cats.implicits._ ``` from the cats integration module. The module should be available on the classpath when using the cats [async-http-client](../catseffect.md) backend. The object contains implicits to convert a cats `MonadError` into the sttp `MonadError`, as well as a way to map the effects wrapper used with the `.mapK` extension method for the backend. diff --git a/docs/backends/wrappers/logging.md b/docs/backends/wrappers/logging.md index e87c28f12a..e1291bbb19 100644 --- a/docs/backends/wrappers/logging.md +++ b/docs/backends/wrappers/logging.md @@ -1,9 +1,9 @@ # Logging -The `sttp.client.logging.LoggingBackend` can log requests and responses which end successfully or with an exception. It can be created given: +The `sttp.client3.logging.LoggingBackend` can log requests and responses which end successfully or with an exception. It can be created given: -* a `sttp.client.logging.Logger`, which is an integration point with logging libraries. Two such integration that are available with sttp-client is slf4j and scribe (see below), but custom ones can be easily added. -* a `sttp.client.logging.Log`, which constructs messages and performs logging actions. A custom implementation can be provided to change default log levels or log message content. +* a `sttp.client3.logging.Logger`, which is an integration point with logging libraries. Two such integration that are available with sttp-client is slf4j and scribe (see below), but custom ones can be easily added. +* a `sttp.client3.logging.Log`, which constructs messages and performs logging actions. A custom implementation can be provided to change default log levels or log message content. By default, the following options are exposed: @@ -23,7 +23,7 @@ The messages are by default logged on these levels: To use the [slf4j](http://www.slf4j.org) logging backend wrapper, add the following dependency to your project: ``` -"com.softwaremill.sttp.client" %% "slf4j-backend" % "@VERSION@" +"com.softwaremill.sttp.client3" %% "slf4j-backend" % "@VERSION@" ``` There are three backend wrappers available, which log request & response information using a slf4j `Logger`. To see the logs, you'll need to use an slf4j-compatible logger implementation, e.g. [logback](http://logback.qos.ch), or use a binding, e.g. [log4j-slf4j](https://logging.apache.org/log4j/2.0/log4j-slf4j-impl/index.html). @@ -31,14 +31,14 @@ There are three backend wrappers available, which log request & response informa Example usage: ```scala mdoc:compile-only -import sttp.client._ -import sttp.client.logging.slf4j.Slf4jLoggingBackend +import sttp.client3._ +import sttp.client3.logging.slf4j.Slf4jLoggingBackend val backend = Slf4jLoggingBackend(HttpURLConnectionBackend()) basicRequest.get(uri"https://httpbin.org/get").send(backend) // Logs: -// 21:14:23.735 [main] INFO sttp.client.logging.slf4j.Slf4jTimingBackend - Request: GET https://httpbin.org/get, took: 0.795s, response: 200 +// 21:14:23.735 [main] INFO sttp.client3.logging.slf4j.Slf4jTimingBackend - Request: GET https://httpbin.org/get, took: 0.795s, response: 200 ``` To create a customised logging backend, see the section on [custom backends](custom.md). @@ -48,5 +48,5 @@ To create a customised logging backend, see the section on [custom backends](cus To use the [scribe](https://github.com/outr/scribe) logging backend wrapper, add the following dependency to your project: ``` -"com.softwaremill.sttp.client" %% "scribe-backend" % "@VERSION@" +"com.softwaremill.sttp.client3" %% "scribe-backend" % "@VERSION@" ``` \ No newline at end of file diff --git a/docs/backends/wrappers/opentracing.md b/docs/backends/wrappers/opentracing.md index c8e281f7c8..98bd73b2aa 100644 --- a/docs/backends/wrappers/opentracing.md +++ b/docs/backends/wrappers/opentracing.md @@ -3,7 +3,7 @@ To use, add the following dependency to your project: ``` -"com.softwaremill.sttp.client" %% "opentracing-backend" % "@VERSION@" +"com.softwaremill.sttp.client3" %% "opentracing-backend" % "@VERSION@" ``` This backend depends on [opentracing](https://github.com/opentracing/opentracing-java), a standardized set of api for distributed tracing. @@ -21,8 +21,8 @@ The backend obtains the current trace context using default spans's propagation There is an additional method exposed to override default operation id: ```scala mdoc:compile-only -import sttp.client._ -import sttp.client.opentracing.OpenTracingBackend._ +import sttp.client3._ +import sttp.client3.opentracing.OpenTracingBackend._ basicRequest .get(???) @@ -32,8 +32,8 @@ basicRequest There is an additional method exposed to customize generated span: ```scala mdoc:compile-only -import sttp.client._ -import sttp.client.opentracing.OpenTracingBackend._ +import sttp.client3._ +import sttp.client3.opentracing.OpenTracingBackend._ basicRequest .get(???) diff --git a/docs/backends/wrappers/prometheus.md b/docs/backends/wrappers/prometheus.md index 582a5dceda..9674d3e68d 100644 --- a/docs/backends/wrappers/prometheus.md +++ b/docs/backends/wrappers/prometheus.md @@ -3,13 +3,13 @@ To use, add the following dependency to your project: ``` -"com.softwaremill.sttp.client" %% "prometheus-backend" % "@VERSION@" +"com.softwaremill.sttp.client3" %% "prometheus-backend" % "@VERSION@" ``` and some imports: ```scala mdoc -import sttp.client.prometheus._ +import sttp.client3.prometheus._ ``` This backend depends on [Prometheus JVM Client](https://github.com/prometheus/client_java). Keep in mind this backend registers histograms and gathers request times, but you have to expose those metrics to [Prometheus](https://prometheus.io/) e.g. using [prometheus-akka-http](https://github.com/lonelyplanet/prometheus-akka-http). @@ -17,34 +17,34 @@ This backend depends on [Prometheus JVM Client](https://github.com/prometheus/cl The Prometheus backend wraps any other backend, for example: ```scala mdoc:compile-only -import sttp.client.akkahttp._ +import sttp.client3.akkahttp._ val backend = PrometheusBackend(AkkaHttpBackend()) ``` It gathers request execution times in `Histogram`. It uses by default `sttp_request_latency` name, defined in `PrometheusBackend.DefaultHistogramName`. It is possible to define custom histograms name by passing function mapping request to histogram name: ```scala mdoc:compile-only -import sttp.client.akkahttp._ +import sttp.client3.akkahttp._ val backend = PrometheusBackend(AkkaHttpBackend(), requestToHistogramNameMapper = request => Some(HistogramCollectorConfig(request.uri.host))) ``` You can disable request histograms by passing `None` returning function: ```scala mdoc:compile-only -import sttp.client.akkahttp._ +import sttp.client3.akkahttp._ val backend = PrometheusBackend(AkkaHttpBackend(), requestToHistogramNameMapper = _ => None) ``` This backend also offers `Gauge` with currently in-progress requests number. It uses by default `sttp_requests_in_progress` name, defined in `PrometheusBackend.DefaultRequestsInProgressGaugeName`. It is possible to define custom gauge name by passing function mapping request to gauge name: ```scala mdoc:compile-only -import sttp.client.akkahttp._ +import sttp.client3.akkahttp._ val backend = PrometheusBackend(AkkaHttpBackend(), requestToInProgressGaugeNameMapper = request => Some(CollectorConfig(request.uri.host))) ``` You can disable request in-progress gauges by passing `None` returning function: ```scala mdoc:compile-only -import sttp.client.akkahttp._ +import sttp.client3.akkahttp._ val backend = PrometheusBackend(AkkaHttpBackend(), requestToInProgressGaugeNameMapper = _ => None) ``` diff --git a/docs/backends/wrappers/zio-opentracing.md b/docs/backends/wrappers/zio-opentracing.md index 36f7e70f3c..ab48603fb7 100644 --- a/docs/backends/wrappers/zio-opentracing.md +++ b/docs/backends/wrappers/zio-opentracing.md @@ -3,7 +3,7 @@ To use, add the following dependency to your project: ``` -"com.softwaremill.sttp.client" %% "zio-telemetry-opentracing-backend" % "@VERSION@" +"com.softwaremill.sttp.client3" %% "zio-telemetry-opentracing-backend" % "@VERSION@" ``` This backend depends on [zio-opentracing](https://github.com/zio/zio-telemetry). @@ -19,10 +19,10 @@ new ZioTelemetryOpenTracingBackend(zioBackend) Additionally you can add tags per request by supplying a `ZioTelemetryOpenTracingTracer` ```scala mdoc:compile-only -import sttp.client._ +import sttp.client3._ import zio._ import zio.telemetry.opentracing._ -import sttp.client.ziotelemetry.opentracing._ +import sttp.client3.ziotelemetry.opentracing._ implicit val zioBackend: SttpBackend[Task, Any] = ??? diff --git a/docs/backends/zio.md b/docs/backends/zio.md index e6781aa83a..a465a14f58 100644 --- a/docs/backends/zio.md +++ b/docs/backends/zio.md @@ -7,7 +7,7 @@ The [ZIO](https://github.com/zio/zio) backends are **asynchronous**. Sending a r To use, add the following dependency to your project: ```scala -"com.softwaremill.sttp.client" %% "async-http-client-backend-zio" % "@VERSION@" +"com.softwaremill.sttp.client3" %% "async-http-client-backend-zio" % "@VERSION@" ``` This backend depends on [async-http-client](https://github.com/AsyncHttpClient/async-http-client), uses [Netty](http://netty.io) behind the scenes and supports effect cancellation. This backend works with all Scala versions. A Dotty build is available as well. @@ -20,8 +20,8 @@ Next you'll need to define a backend instance as an implicit value. This can be A non-comprehensive summary of how the backend can be created is as follows: ```scala mdoc:compile-only -import sttp.client._ -import sttp.client.asynchttpclient.zio.AsyncHttpClientZioBackend +import sttp.client3._ +import sttp.client3.asynchttpclient.zio.AsyncHttpClientZioBackend AsyncHttpClientZioBackend().flatMap { backend => ??? } @@ -53,13 +53,13 @@ val backend = AsyncHttpClientZioBackend.usingClient(runtime, asyncHttpClient) To use, add the following dependency to your project: ``` -"com.softwaremill.sttp.client" %% "httpclient-backend-zio" % "@VERSION@" +"com.softwaremill.sttp.client3" %% "httpclient-backend-zio" % "@VERSION@" ``` Create the backend using: ```scala mdoc:compile-only -import sttp.client.httpclient.zio.HttpClientZioBackend +import sttp.client3.httpclient.zio.HttpClientZioBackend HttpClientZioBackend().flatMap { backend => ??? } @@ -79,12 +79,12 @@ This backend is based on the built-in `java.net.http.HttpClient` available from As an alternative to effectfully or resourcefully creating backend instances, ZIO environment can be used. In this case, a type alias is provided for the service definition: ```scala -package sttp.client.asynchttpclient.zio +package sttp.client3.asynchttpclient.zio type SttpClient = Has[SttpBackend[Task, ZioStreams with WebSockets]] // or, when using Java 11 & HttpClient -package sttp.client.httpclient.zio +package sttp.client3.httpclient.zio type SttpClient = Has[SttpBackend[BlockingTask, BlockingZioStreams with WebSockets]] ``` @@ -93,8 +93,8 @@ The lifecycle of the `SttpClient` service is described by `ZLayer`s, which can b The `SttpClient` companion object contains effect descriptions which use the `SttpClient` service from the environment to send requests or open websockets. This is different from sttp usage with other effect libraries (which use an implicit backend when `.send(backend)` is invoked on the request), but is more in line with how other ZIO services work. For example: ```scala mdoc:compile-only -import sttp.client._ -import sttp.client.asynchttpclient.zio._ +import sttp.client3._ +import sttp.client3.asynchttpclient.zio._ import zio._ val request = basicRequest.get(uri"https://httpbin.org/get") @@ -106,14 +106,14 @@ val sent: ZIO[SttpClient, Throwable, Response[Either[String, String]]] = The ZIO based backends support streaming using zio-streams. The following example is using the `AsyncHttpClientZioBackend` backend, but works similarly with `HttpClientZioBackend`. -The type of supported streams is `Stream[Throwable, Byte]`. The streams capability is represented as `sttp.client.impl.zio.ZioStreams`. To leverage ZIO environment, use the `SttpClient` object to create request send effects. +The type of supported streams is `Stream[Throwable, Byte]`. The streams capability is represented as `sttp.client3.impl.zio.ZioStreams`. To leverage ZIO environment, use the `SttpClient` object to create request send effects. Requests can be sent with a streaming body: ```scala mdoc:compile-only import sttp.capabilities.zio.ZioStreams -import sttp.client._ -import sttp.client.asynchttpclient.zio.send +import sttp.client3._ +import sttp.client3.asynchttpclient.zio.send import zio.stream._ val s: Stream[Throwable, Byte] = ??? @@ -129,8 +129,8 @@ And receive response bodies as a stream: ```scala mdoc:compile-only import sttp.capabilities.zio.ZioStreams -import sttp.client._ -import sttp.client.asynchttpclient.zio.{SttpClient, send} +import sttp.client3._ +import sttp.client3.asynchttpclient.zio.{SttpClient, send} import zio._ import zio.stream._ @@ -156,11 +156,11 @@ The ZIO backends also support a ZIO-familiar way of configuring [stubs](../testi usual way of creating a stand-alone stub, you can also define your stubs as effects instead: ```scala mdoc:compile-only -import sttp.client._ +import sttp.client3._ import sttp.model._ -import sttp.client.asynchttpclient._ -import sttp.client.asynchttpclient.zio._ -import sttp.client.asynchttpclient.zio.stubbing._ +import sttp.client3.asynchttpclient._ +import sttp.client3.asynchttpclient.zio._ +import sttp.client3.asynchttpclient.zio.stubbing._ val stubEffect = for { _ <- whenRequestMatches(_.uri.toString.endsWith("c")).thenRespond("c") diff --git a/docs/conf/proxy.md b/docs/conf/proxy.md index 028ff03059..e55df57830 100644 --- a/docs/conf/proxy.md +++ b/docs/conf/proxy.md @@ -13,7 +13,7 @@ Settings are loaded **in given order** and the **first existing value** is being Otherwise, proxy values can be specified manually when creating a backend: ```scala mdoc:compile-only -import sttp.client._ +import sttp.client3._ val backend = HttpURLConnectionBackend( options = SttpBackendOptions.httpProxy("some.host", 8080)) @@ -26,7 +26,7 @@ basicRequest Or in case your proxy requires authentication (supported by the JVM backends): ```scala mdoc:compile-only -import sttp.client._ +import sttp.client3._ SttpBackendOptions.httpProxy("some.host", 8080, "username", "password") ``` diff --git a/docs/conf/redirects.md b/docs/conf/redirects.md index 826beeeb8f..d57ced98c4 100644 --- a/docs/conf/redirects.md +++ b/docs/conf/redirects.md @@ -5,7 +5,7 @@ By default, sttp follows redirects. If you'd like to disable following redirects, use the `followRedirects` method: ```scala mdoc:compile-only -import sttp.client._ +import sttp.client3._ basicRequest.followRedirects(false) ``` @@ -19,7 +19,7 @@ If a `POST` or `PUT` request is redirected, by default it will be sent unchanged To enable this behavior, use the `redirectToGet` method: ```scala mdoc:compile-only -import sttp.client._ +import sttp.client3._ basicRequest.redirectToGet(true) ``` diff --git a/docs/conf/timeouts.md b/docs/conf/timeouts.md index 1fe5ada4dd..ebdfedf85d 100644 --- a/docs/conf/timeouts.md +++ b/docs/conf/timeouts.md @@ -8,7 +8,7 @@ sttp supports read and connection timeouts: How to use: ```scala mdoc:compile-only -import sttp.client._ +import sttp.client3._ import scala.concurrent.duration._ // all backends provide a constructor that allows to specify backend options diff --git a/docs/examples.md b/docs/examples.md index 968a86de8f..9a8035b325 100644 --- a/docs/examples.md +++ b/docs/examples.md @@ -7,7 +7,7 @@ All of the examples are available [in the sources](https://github.com/softwaremi Required dependencies: ```scala -libraryDependencies ++= List("com.softwaremill.sttp.client" %% "core" % "@VERSION@") +libraryDependencies ++= List("com.softwaremill.sttp.client3" %% "core" % "@VERSION@") ``` Example code: @@ -23,8 +23,8 @@ Required dependencies: ```scala libraryDependencies ++= List( - "com.softwaremill.sttp.client" %% "akka-http-backend" % "@VERSION@", - "com.softwaremill.sttp.client" %% "json4s" % "@VERSION@", + "com.softwaremill.sttp.client3" %% "akka-http-backend" % "@VERSION@", + "com.softwaremill.sttp.client3" %% "json4s" % "@VERSION@", "org.json4s" %% "json4s-native" % "3.6.0" ) ``` @@ -42,8 +42,8 @@ Required dependencies: ```scala libraryDependencies ++= List( - "com.softwaremill.sttp.client" %% "async-http-client-backend-zio" % "@VERSION@", - "com.softwaremill.sttp.client" %% "circe" % "@VERSION@", + "com.softwaremill.sttp.client3" %% "async-http-client-backend-zio" % "@VERSION@", + "com.softwaremill.sttp.client3" %% "circe" % "@VERSION@", "io.circe" %% "circe-generic" % "@CIRCE_VERSION@" ) ``` @@ -61,8 +61,8 @@ Required dependencies: ```scala libraryDependencies ++= List( - "com.softwaremill.sttp.client" %% "async-http-client-backend-monix" % "@VERSION@", - "com.softwaremill.sttp.client" %% "circe" % "@VERSION@", + "com.softwaremill.sttp.client3" %% "async-http-client-backend-monix" % "@VERSION@", + "com.softwaremill.sttp.client3" %% "circe" % "@VERSION@", "io.circe" %% "circe-generic" % "@CIRCE_VERSION@" ) ``` @@ -80,8 +80,8 @@ Required dependencies: ```scala libraryDependencies ++= List( - "com.softwaremill.sttp.client" %% "slf4j-backend" % "@VERSION@", - "com.softwaremill.sttp.client" %% "circe" % "@VERSION@", + "com.softwaremill.sttp.client3" %% "slf4j-backend" % "@VERSION@", + "com.softwaremill.sttp.client3" %% "circe" % "@VERSION@", "io.circe" %% "circe-generic" % "@CIRCE_VERSION@" ) ``` @@ -99,8 +99,8 @@ Required dependencies: ```scala libraryDependencies ++= List( - "com.softwaremill.sttp.client" %% "async-http-client-backend-monix" % "@VERSION@", - "com.softwaremill.sttp.client" %% "circe" % "@VERSION@", + "com.softwaremill.sttp.client3" %% "async-http-client-backend-monix" % "@VERSION@", + "com.softwaremill.sttp.client3" %% "circe" % "@VERSION@", "io.circe" %% "circe-generic" % "@CIRCE_VERSION@" ) ``` @@ -117,7 +117,7 @@ Example code: Required dependencies: ```scala -libraryDependencies ++= List("com.softwaremill.sttp.client" %% "core" % "@VERSION@") +libraryDependencies ++= List("com.softwaremill.sttp.client3" %% "core" % "@VERSION@") ``` Example code: @@ -132,7 +132,7 @@ Example code: Required dependencies: ```scala -libraryDependencies ++= List("com.softwaremill.sttp.client" %% "async-http-client-backend-zio" % "@VERSION@") +libraryDependencies ++= List("com.softwaremill.sttp.client3" %% "async-http-client-backend-zio" % "@VERSION@") ``` Example code: @@ -147,7 +147,7 @@ Example code: Required dependencies: ```scala -libraryDependencies ++= List("com.softwaremill.sttp.client" %% "async-http-client-backend-fs2 % "@VERSION@") +libraryDependencies ++= List("com.softwaremill.sttp.client3" %% "async-http-client-backend-fs2 % "@VERSION@") ``` Example code: @@ -162,7 +162,7 @@ Example code: Required dependencies: ```scala -libraryDependencies ++= List("com.softwaremill.sttp.client" %% "async-http-client-backend-monix % "@VERSION@") +libraryDependencies ++= List("com.softwaremill.sttp.client3" %% "async-http-client-backend-monix % "@VERSION@") ``` Example code: @@ -177,7 +177,7 @@ Example code: Required dependencies: ```scala -libraryDependencies ++= List("com.softwaremill.sttp.client" %% "akka-http-backend" % "@VERSION@") +libraryDependencies ++= List("com.softwaremill.sttp.client3" %% "akka-http-backend" % "@VERSION@") ``` Example code: @@ -192,7 +192,7 @@ Example code: Required dependencies: ```scala -libraryDependencies ++= List("com.softwaremill.sttp.client" %% "async-http-client-backend-monix" % "@VERSION@") +libraryDependencies ++= List("com.softwaremill.sttp.client3" %% "async-http-client-backend-monix" % "@VERSION@") ``` Example code: @@ -207,7 +207,7 @@ Example code: Required dependencies: ```scala -libraryDependencies ++= List("com.softwaremill.sttp.client" %% "async-http-client-backend-fs2" % "@VERSION@") +libraryDependencies ++= List("com.softwaremill.sttp.client3" %% "async-http-client-backend-fs2" % "@VERSION@") ``` Example code: @@ -222,7 +222,7 @@ Example code: Required dependencies: ```scala -libraryDependencies ++= List("com.softwaremill.sttp.client" %% "async-http-client-backend-zio" % "@VERSION@") +libraryDependencies ++= List("com.softwaremill.sttp.client3" %% "async-http-client-backend-zio" % "@VERSION@") ``` Example code: @@ -237,7 +237,7 @@ Example code: Required dependencies: ```scala -libraryDependencies ++= List("com.softwaremill.sttp.client" %% "async-http-client-backend-zio" % "@VERSION@") +libraryDependencies ++= List("com.softwaremill.sttp.client3" %% "async-http-client-backend-zio" % "@VERSION@") ``` Example code: @@ -252,7 +252,7 @@ Example code: Required dependencies: ```scala -libraryDependencies ++= List("com.softwaremill.sttp.client" %% "core" % "@VERSION@") +libraryDependencies ++= List("com.softwaremill.sttp.client3" %% "core" % "@VERSION@") ``` Example code: diff --git a/docs/how.md b/docs/how.md index f8ab6073d5..4b8cfbb4fa 100644 --- a/docs/how.md +++ b/docs/how.md @@ -4,18 +4,18 @@ This first step when using sttp client is describing the request that you'd like to send. -A request is represented as an immutable data structure of type `RequestT` (as in Request Template). The basic request is provided as the `basicRequest` value, in the `sttp.client` package. It can be refined using one of the available methods, such as `.header`, `.body`, `.get(Uri)`, `.responseAs`, etc. +A request is represented as an immutable data structure of type `RequestT` (as in Request Template). The basic request is provided as the `basicRequest` value, in the `sttp.client3` package. It can be refined using one of the available methods, such as `.header`, `.body`, `.get(Uri)`, `.responseAs`, etc. A `RequestT` value contains both information on what to include in the request, but also how to handle the response body. To start describing a request, import the sttp client package and customise `basicRequest`: ```scala mdoc:compile-only -import sttp.client._ +import sttp.client3._ val myRequest: Request[_, _] = ??? // basicRequest.(...) ``` -An alternative to importing the `sttp.client._` package, is to extend the `sttp.client.SttpApi` trait. That way, multiple integrations can be grouped in one object, thus reducing the number of necessary imports. +An alternative to importing the `sttp.client3._` package, is to extend the `sttp.client3.SttpApi` trait. That way, multiple integrations can be grouped in one object, thus reducing the number of necessary imports. ## Send the request @@ -30,7 +30,7 @@ Backends manage the connection pool, thread pools for handling responses, depend For example, the following sends a synchronous request, using the default JVM backend: ```scala mdoc:compile-only -import sttp.client._ +import sttp.client3._ val myRequest: Request[String, Any] = ??? val backend = HttpURLConnectionBackend() val response = myRequest.send(backend) diff --git a/docs/index.md b/docs/index.md index 8d4ada7fb1..9f5cfdf6d3 100644 --- a/docs/index.md +++ b/docs/index.md @@ -10,7 +10,7 @@ Backend implementations include ones based on [akka-http](https://doc.akka.io/do Here's a very quick example of sttp client in action: ```scala mdoc:compile-only -import sttp.client._ +import sttp.client3._ val query = "http language:scala" val sort: Option[String] = None diff --git a/docs/json.md b/docs/json.md index 28525e5cf0..0bb67186dc 100644 --- a/docs/json.md +++ b/docs/json.md @@ -2,7 +2,7 @@ Adding support for JSON (or other format) bodies in requests/responses is a matter of providing a [body serializer](requests/body.md) and/or a [response body specification](responses/body.md). Both are quite straightforward to implement, so integrating with your favorite JSON library shouldn't be a problem. However, there are some integrations available out-of-the-box. -Each integration is available as an import, which brings the implicit `BodySerializer`s and `asJson` methods into scope. Alternatively, these values are grouped intro traits (e.g. `sttp.client.circe.SttpCirceApi`), which can be extended to group multiple integrations in one object, and thus reduce the number of necessary imports. +Each integration is available as an import, which brings the implicit `BodySerializer`s and `asJson` methods into scope. Alternatively, these values are grouped intro traits (e.g. `sttp.client3.circe.SttpCirceApi`), which can be extended to group multiple integrations in one object, and thus reduce the number of necessary imports. The following variants of `asJson` methods are available: @@ -13,7 +13,7 @@ The following variants of `asJson` methods are available: The type signatures vary depending on the underlying library (required implicits and error representation differs), but they obey the following pattern: ```scala mdoc:compile-only -import sttp.client._ +import sttp.client3._ def asJson[B]: ResponseAs[Either[ResponseException[String, Exception], B], Any] = ??? def asJsonAlways[B]: ResponseAs[Either[DeserializationException[Exception], B], Any] = ??? @@ -34,7 +34,7 @@ case class ResponsePayload(data: String) JSON encoding of bodies and decoding of responses can be handled using [Circe](https://circe.github.io/circe/) by the `circe` module. To use add the following dependency to your project: ```scala -"com.softwaremill.sttp.client" %% "circe" % "@VERSION@" +"com.softwaremill.sttp.client3" %% "circe" % "@VERSION@" ``` This module adds a body serialized, so that json payloads can be sent as request bodies. To send a payload of type `T` as json, a `io.circe.Encoder[T]` implicit value must be available in scope. @@ -43,8 +43,8 @@ Automatic and semi-automatic derivation of encoders is possible by using the [ci Response can be parsed into json using `asJson[T]`, provided there's an implicit `io.circe.Decoder[T]` in scope. The decoding result will be represented as either a http/deserialization error, or the parsed value. For example: ```scala mdoc:compile-only -import sttp.client._ -import sttp.client.circe._ +import sttp.client3._ +import sttp.client3.circe._ val backend: SttpBackend[Identity, Any] = HttpURLConnectionBackend() @@ -66,7 +66,7 @@ Arbitrary JSON structures can be traversed by parsing the result as `io.circe.Js To encode and decode json using json4s, add the following dependency to your project: ``` -"com.softwaremill.sttp.client" %% "json4s" % "@VERSION@" +"com.softwaremill.sttp.client3" %% "json4s" % "@VERSION@" "org.json4s" %% "json4s-native" % "3.6.0" ``` @@ -77,8 +77,8 @@ Using this module it is possible to set request bodies and read response bodies Usage example: ```scala mdoc:compile-only -import sttp.client._ -import sttp.client.json4s._ +import sttp.client3._ +import sttp.client3.json4s._ val backend: SttpBackend[Identity, Any] = HttpURLConnectionBackend() @@ -100,7 +100,7 @@ val response: Identity[Response[Either[ResponseException[String, Exception], Res To encode and decode JSON using [spray-json](https://github.com/spray/spray-json), add the following dependency to your project: ``` -"com.softwaremill.sttp.client" %% "spray-json" % "@VERSION@" +"com.softwaremill.sttp.client3" %% "spray-json" % "@VERSION@" ``` Using this module it is possible to set request bodies and read response bodies as your custom types, using the implicitly available instances of `spray.json.JsonWriter` / `spray.json.JsonReader` or `spray.json.JsonFormat`. @@ -108,8 +108,8 @@ Using this module it is possible to set request bodies and read response bodies Usage example: ```scala mdoc:compile-only -import sttp.client._ -import sttp.client.sprayJson._ +import sttp.client3._ +import sttp.client3.sprayJson._ import spray.json._ val backend: SttpBackend[Identity, Any] = HttpURLConnectionBackend() @@ -132,7 +132,7 @@ val response: Identity[Response[Either[ResponseException[String, Exception], Res To encode and decode JSON using [play-json](https://www.playframework.com), add the following dependency to your project: ```scala -"com.softwaremill.sttp.client" %% "play-json" % "@VERSION@" +"com.softwaremill.sttp.client3" %% "play-json" % "@VERSION@" ``` -To use, add an import: `import sttp.client.playJson._`. +To use, add an import: `import sttp.client3.playJson._`. diff --git a/docs/model/model.md b/docs/model/model.md index 31570643aa..16a01629a2 100644 --- a/docs/model/model.md +++ b/docs/model/model.md @@ -20,7 +20,7 @@ The model also contains aggregate/helper classes such as `Headers` and `MultiQue Example with objects: ```scala mdoc:compile-only -import sttp.client._ +import sttp.client3._ import sttp.model._ object Example { @@ -36,7 +36,7 @@ object Example { Example with traits: ```scala mdoc:compile-only -import sttp.client._ +import sttp.client3._ import sttp.model._ object Example extends HeaderNames with MediaTypes with StatusCodes { diff --git a/docs/model/uri.md b/docs/model/uri.md index fdf73bbf9d..081a8fbe83 100644 --- a/docs/model/uri.md +++ b/docs/model/uri.md @@ -11,7 +11,7 @@ The `Uri` class is immutable, and can be constructed by hand, but in many cases Using the URI interpolator it's possible to conveniently create `Uri` instances, for example: ```scala mdoc:compile-only -import sttp.client._ +import sttp.client3._ import sttp.model._ val user = "Mary Smith" @@ -30,7 +30,7 @@ Any values embedded in the URI will be URL-encoded, taking into account the cont All components of the URI can be embedded from values: scheme, username/password, host, port, path, query and fragment. The embedded values won't be further parsed, with the exception of the `:` in the host part, which is commonly used to pass in both the host and port: ```scala mdoc -import sttp.client._ +import sttp.client3._ // the embedded / is escaped println(uri"http://example.org/${"a/b"}") @@ -96,7 +96,7 @@ This is useful when a base URI is stored in a value, and can then be used as a b A fully-featured example: ```scala mdoc:silent -import sttp.client._ +import sttp.client3._ val secure = true val scheme = if (secure) "https" else "http" val subdomains = List("sub1", "sub2") diff --git a/docs/openapi.md b/docs/openapi.md index 00a1a28451..c8d00d7b16 100644 --- a/docs/openapi.md +++ b/docs/openapi.md @@ -36,8 +36,8 @@ lazy val petstoreApi: Project = project openApiGeneratorName := "scala-sttp", openApiOutputDir := baseDirectory.value.name, libraryDependencies ++= Seq( - "com.softwaremill.sttp.client" %% "core" % "@VERSION@", - "com.softwaremill.sttp.client" %% "json4s" % "@VERSION@", + "com.softwaremill.sttp.client3" %% "core" % "@VERSION@", + "com.softwaremill.sttp.client3" %% "json4s" % "@VERSION@", "org.json4s" %% "json4s-jackson" % "3.6.8" ) ) @@ -87,8 +87,8 @@ lazy val petstoreApi: Project = project openApiOutputDir := baseDirectory.value.name, openApiIgnoreFileOverride := s"${baseDirectory.in(ThisBuild).value.getPath}/openapi-ignore-file", libraryDependencies ++= Seq( - "com.softwaremill.sttp.client" %% "core" % "@VERSION@", - "com.softwaremill.sttp.client" %% "json4s" % "@VERSION@", + "com.softwaremill.sttp.client3" %% "core" % "@VERSION@", + "com.softwaremill.sttp.client3" %% "json4s" % "@VERSION@", "org.json4s" %% "json4s-jackson" % "3.6.8" ), (compile in Compile) := ((compile in Compile) dependsOn openApiGenerate).value, diff --git a/docs/quickstart.md b/docs/quickstart.md index bdc19850c4..294e135dc0 100644 --- a/docs/quickstart.md +++ b/docs/quickstart.md @@ -9,7 +9,7 @@ To integrate with other parts of your application, you'll often need to use an a The basic dependency which provides the API and the default synchronous backend is: ```scala -"com.softwaremill.sttp.client" %% "core" % "@VERSION@" +"com.softwaremill.sttp.client3" %% "core" % "@VERSION@" ``` `sttp client` is available for Scala 2.11, 2.12 and 2.13, and requires Java 8, as well as for Dotty (Scala 3) 0.23. @@ -21,27 +21,27 @@ The basic dependency which provides the API and the default synchronous backend If you are an [Ammonite](https://ammonite.io) user, you can quickly start experimenting with sttp by copy-pasting the following: ```scala -import $ivy.`com.softwaremill.sttp.client::core:@VERSION@` -import sttp.client.quick._ +import $ivy.`com.softwaremill.sttp.client3::core:@VERSION@` +import sttp.client3.quick._ quickRequest.get(uri"http://httpbin.org/ip").send(backend) ``` -Importing the `quick` object has the same effect as importing `sttp.client._`, plus defining an implicit synchronous backend (`implict val backend = HttpURLConnectionBackend()`), so that sttp can be used right away. +Importing the `quick` object has the same effect as importing `sttp.client3._`, plus defining an implicit synchronous backend (`implict val backend = HttpURLConnectionBackend()`), so that sttp can be used right away. If the default `HttpURLConnectionBackend` for some reason is insufficient, you can also use one based on OkHttp: ```scala -import $ivy.`com.softwaremill.sttp.client::okhttp-backend:@VERSION@` -import sttp.client.okhttp.quick._ +import $ivy.`com.softwaremill.sttp.client3::okhttp-backend:@VERSION@` +import sttp.client3.okhttp.quick._ quickRequest.get(uri"http://httpbin.org/ip").send(backend) ``` ## Imports -Working with sttp is most convenient if you import the `sttp.client` package entirely: +Working with sttp is most convenient if you import the `sttp.client3` package entirely: ```scala -import sttp.client._ +import sttp.client3._ ``` This brings into scope the starting point for defining requests and some helper methods. All examples in this guide assume that this import is in place. @@ -49,7 +49,7 @@ This brings into scope the starting point for defining requests and some helper And that's all you need to start using sttp client! To create and send your first request, import the above, type `basicRequest.` and see where your IDE's auto-complete gets you! Here's a simple request, using the synchronous backend: ```scala -import sttp.client._ +import sttp.client3._ val backend = HttpURLConnectionBackend() val response = basicRequest diff --git a/docs/requests/authentication.md b/docs/requests/authentication.md index ea31f24e92..8ba6a97af4 100644 --- a/docs/requests/authentication.md +++ b/docs/requests/authentication.md @@ -5,7 +5,7 @@ sttp supports basic, bearer-token based authentication and digest authentication Basic authentication, using which the username and password are encoded using Base64, can be added as follows: ```scala mdoc:silent -import sttp.client._ +import sttp.client3._ val username = "mary" val password = "p@assword" @@ -60,7 +60,7 @@ You can use sttp with OAuth2. Looking at the [OAuth2 protocol flow](https://tool 2. (C)/(D) - You need to send a request to the authentication server, passing in the authentication code from step 1. You'll receive an access token in response (and optionally a refresh token). For example, if you were using GitHub as your authentication server, you'd need to take the values of `clientId` and `clientSecret` from the GitHub settings, then take the `authCode` received in step 1 above, and send a request like this: ```scala mdoc:compile-only -import sttp.client.circe._ +import sttp.client3.circe._ import io.circe._ import io.circe.generic.semiauto._ diff --git a/docs/requests/basics.md b/docs/requests/basics.md index 0066e388fc..5865fb0feb 100644 --- a/docs/requests/basics.md +++ b/docs/requests/basics.md @@ -3,7 +3,7 @@ As mentioned in the [quickstart](../quickstart.md), the following import will be needed: ```scala mdoc -import sttp.client._ +import sttp.client3._ ``` This brings into scope `basicRequest`, the starting request. This request can be customised, each time yielding a new, immutable request definition (unless a mutable body is set on the request, such as a byte array). As the request definition is immutable, it can be freely stored in values, shared across threads, and customized multiple times in various ways. diff --git a/docs/requests/body.md b/docs/requests/body.md index 52876853ae..dbbf3453bb 100644 --- a/docs/requests/body.md +++ b/docs/requests/body.md @@ -11,14 +11,14 @@ In its simplest form, the request's body can be set as a `String`. By default, t A `String` body can be set on a request as follows: ```scala mdoc:compile-only -import sttp.client._ +import sttp.client3._ basicRequest.body("Hello, world!") ``` It is also possible to use a different character encoding: ```scala mdoc:compile-only -import sttp.client._ +import sttp.client3._ basicRequest.body("Hello, world!", "utf-8") ``` @@ -27,7 +27,7 @@ basicRequest.body("Hello, world!", "utf-8") To set a binary-data body, the following methods are available: ```scala mdoc:compile-only -import sttp.client._ +import sttp.client3._ val bytes: Array[Byte] = ??? basicRequest.body(bytes) @@ -54,7 +54,7 @@ If not specified before, these methods will set the content type to `application To upload a file, simply set the request body as a `File` or `Path`: ```scala mdoc:compile-only -import sttp.client._ +import sttp.client3._ import java.io.File basicRequest.body(new File("data.txt")) @@ -76,7 +76,7 @@ If you set the body as a `Map[String, String]` or `Seq[(String, String)]`, it wi By default, the `UTF-8` encoding is used, but can be also specified explicitly: ```scala mdoc:compile-only -import sttp.client._ +import sttp.client3._ basicRequest.body(Map("k1" -> "v1")) basicRequest.body(Map("k1" -> "v1"), "utf-8") basicRequest.body("k1" -> "v1", "k2" -> "v2") @@ -96,7 +96,7 @@ A `BasicRequestBody` is a wrapper for one of the supported request body types: a For example, here's how to write a custom serializer for a case class, with serializer-specific default content type: ```scala mdoc:compile-only -import sttp.client._ +import sttp.client3._ import sttp.model.MediaType case class Person(name: String, surname: String, age: Int) diff --git a/docs/requests/cookies.md b/docs/requests/cookies.md index 6ea7f8ea45..94061d8d72 100644 --- a/docs/requests/cookies.md +++ b/docs/requests/cookies.md @@ -7,7 +7,7 @@ Cookies are currently only available on the JVM. Cookies can also be set using the following methods: ```scala mdoc:compile-only -import sttp.client._ +import sttp.client3._ import sttp.model._ basicRequest @@ -22,7 +22,7 @@ basicRequest It is often necessary to copy cookies from a response, e.g. after a login request is sent, and a successful response with the authentication cookie received. Having an object `response: Response[_]`, cookies on a request can be copied: ```scala mdoc:compile-only -import sttp.client._ +import sttp.client3._ val backend = HttpURLConnectionBackend() val loginRequest = basicRequest @@ -37,7 +37,7 @@ basicRequest.cookies(response) Or, it's also possible to store only the `sttp.model.CookieWithMeta` objects (a sequence of which can be obtained from a response), and set the on the request: ```scala mdoc:compile-only -import sttp.client._ +import sttp.client3._ val backend = HttpURLConnectionBackend() val loginRequest = basicRequest diff --git a/docs/requests/headers.md b/docs/requests/headers.md index a315f4e23e..f7b6763ee8 100644 --- a/docs/requests/headers.md +++ b/docs/requests/headers.md @@ -3,7 +3,7 @@ Arbitrary headers can be set on the request using the `.header` method: ```scala mdoc:compile-only -import sttp.client._ +import sttp.client3._ basicRequest.header("User-Agent", "myapp") ``` @@ -15,7 +15,7 @@ While most headers should be set only once on a request, HTTP allows setting a h There are also variants of this method accepting a number of headers: ```scala mdoc:compile-only -import sttp.client._ +import sttp.client3._ import sttp.model._ basicRequest.header(Header("k1", "v1"), replaceExisting = false) @@ -30,7 +30,7 @@ basicRequest.headers(Header("k9", "v9"), Header("k10", "v10"), Header("k11", "v1 For some common headers, dedicated methods are provided: ```scala mdoc:compile-only -import sttp.client._ +import sttp.client3._ basicRequest.contentType("application/json") basicRequest.contentType("application/json", "iso-8859-1") diff --git a/docs/requests/multipart.md b/docs/requests/multipart.md index 16b2a29433..aab1775c2f 100644 --- a/docs/requests/multipart.md +++ b/docs/requests/multipart.md @@ -1,6 +1,6 @@ # Multipart requests -To set a multipart body on a request, the `multipartBody` method should be used (instead of `body`). Each body part is represented as an instance of `Part[BasicRequestBody]`, which can be conveniently constructed using `multipart` methods coming from the `sttp.client` package. +To set a multipart body on a request, the `multipartBody` method should be used (instead of `body`). Each body part is represented as an instance of `Part[BasicRequestBody]`, which can be conveniently constructed using `multipart` methods coming from the `sttp.client3` package. A single part of a multipart request consist of a mandatory name and a payload of type: @@ -18,7 +18,7 @@ The content type of each part is by default the same as when setting simple bodi The parts can be specified using either a `Seq[Multipart]` or by using multiple arguments: ```scala mdoc:compile-only -import sttp.client._ +import sttp.client3._ basicRequest.multipartBody(Seq(multipart("p1", "v1"), multipart("p2", "v2"))) basicRequest.multipartBody(multipart("p1", "v1"), multipart("p2", "v2")) @@ -27,7 +27,7 @@ basicRequest.multipartBody(multipart("p1", "v1"), multipart("p2", "v2")) For example: ```scala mdoc:compile-only -import sttp.client._ +import sttp.client3._ import java.io._ val someFile = new File("/sample/path") @@ -44,7 +44,7 @@ basicRequest.multipartBody( For each part, an optional filename can be specified, as well as a custom content type and additional headers. For example: ```scala mdoc:compile-only -import sttp.client._ +import sttp.client3._ import java.io._ val logoFile = new File("/sample/path/logo123.jpg") diff --git a/docs/requests/streaming.md b/docs/requests/streaming.md index 098daabb50..0cc99c4b16 100644 --- a/docs/requests/streaming.md +++ b/docs/requests/streaming.md @@ -13,7 +13,7 @@ An implementation of the `Streams[S]` capability must be passed to the `.streamB For example, using the [akka-http backend](../backends/akka.md), a request with a streaming body can be defined as follows: ```scala mdoc:compile-only -import sttp.client._ +import sttp.client3._ import sttp.capabilities.akka.AkkaStreams import akka.stream.scaladsl.Source diff --git a/docs/responses/basics.md b/docs/responses/basics.md index 835b7ea724..460b587e03 100644 --- a/docs/responses/basics.md +++ b/docs/responses/basics.md @@ -20,7 +20,7 @@ Individual headers can be obtained using the methods: ```scala mdoc:silent import sttp.model._ -import sttp.client._ +import sttp.client3._ val backend = HttpURLConnectionBackend() val request = basicRequest .get(uri"http://endpoint.com/example") diff --git a/docs/responses/body.md b/docs/responses/body.md index 689725c3a1..111743a88c 100644 --- a/docs/responses/body.md +++ b/docs/responses/body.md @@ -14,7 +14,7 @@ How the response body will be read is part of the request description, as alread To conveniently specify how to deserialize the response body, a number of `as(...Type...)` methods are available. They can be used to provide a value for the request description's `response` property: ```scala mdoc:compile-only -import sttp.client._ +import sttp.client3._ basicRequest.response(asByteArray) ``` @@ -24,7 +24,7 @@ When the above request is completely described and sent, it will result in a `Re Other possible response descriptions include (the first type parameter of `ResponseAs` specifies the type returned as the response body, the second - the capabilities that the backend is required to support to send the request; `Any` means no special requirements): ```scala mdoc:compile-only -import sttp.client._ +import sttp.client3._ import java.io.File import java.nio.file.Path @@ -56,7 +56,7 @@ def asBothOption[A, B, R](l: ResponseAs[A, R], r: ResponseAs[B, Any]): ResponseA Hence, to discard the response body, the request description should include the following: ```scala mdoc:compile-only -import sttp.client._ +import sttp.client3._ basicRequest.response(ignore) ``` @@ -64,7 +64,7 @@ basicRequest.response(ignore) And to save the response to a file: ```scala mdoc:compile-only -import sttp.client._ +import sttp.client3._ import java.io._ val someFile = new File("some/path") @@ -80,7 +80,7 @@ basicRequest.response(asFile(someFile)) Sometimes it's convenient to get a failed effect (or an exception thrown) when the response status code is not successful. In such cases, the response specification can be modified using the `.getRight` combinator: ```scala mdoc:compile-only -import sttp.client._ +import sttp.client3._ basicRequest.response(asString.getRight): PartialRequest[String, Any] ``` @@ -102,7 +102,7 @@ It's possible to define custom body deserializers by taking any of the built-in As an example, to read the response body as an int, the following response description can be defined (warning: this ignores the possibility of exceptions!): ```scala mdoc:compile-only -import sttp.client._ +import sttp.client3._ val asInt: ResponseAs[Either[String, Int], Any] = asString.mapRight(_.toInt) @@ -114,7 +114,7 @@ basicRequest To integrate with a third-party JSON library, and always parse the response as a json (regardless of the status code): ```scala mdoc:compile-only -import sttp.client._ +import sttp.client3._ type JsonError type JsonAST @@ -135,9 +135,9 @@ Using the `fromMetadata` combinator, it's possible to dynamically specify how th A more complex case, which uses Circe for deserializing JSON, choosing to which model to deserialize to depending on the status code, can look as following: ```scala mdoc:compile-only -import sttp.client._ +import sttp.client3._ import sttp.model._ -import sttp.client.circe._ +import sttp.client3.circe._ import io.circe._ import io.circe.generic.auto._ @@ -157,9 +157,9 @@ val myRequest: Request[Either[ResponseException[String, io.circe.Error], MyModel The above example assumes that success and error models are part of one hierarchy (`MyModel`). Sometimes http errors are modelled independently of success. In this case, we can use `asJsonEither`, which uses `asEitherDeserialized` under the covers: ```scala mdoc:compile-only -import sttp.client._ +import sttp.client3._ import sttp.model._ -import sttp.client.circe._ +import sttp.client3.circe._ import io.circe._ import io.circe.generic.auto._ @@ -180,7 +180,7 @@ If the backend used supports streaming (see [backends summary](../backends/summa ```scala mdoc:compile-only import sttp.capabilities.{Effect, Streams} -import sttp.client._ +import sttp.client3._ def asStream[F[_], T, S](s: Streams[S])(f: s.BinaryStream => F[T]): ResponseAs[Either[String, T], Effect[F] with S] = ??? @@ -208,8 +208,8 @@ import akka.stream.scaladsl.Source import akka.util.ByteString import scala.concurrent.Future import sttp.capabilities.akka.AkkaStreams -import sttp.client._ -import sttp.client.akkahttp.AkkaHttpBackend +import sttp.client3._ +import sttp.client3.akkahttp.AkkaHttpBackend val backend: SttpBackend[Future, AkkaStreams] = AkkaHttpBackend() diff --git a/docs/responses/exceptions.md b/docs/responses/exceptions.md index b13a7d37fa..fd89d50a79 100644 --- a/docs/responses/exceptions.md +++ b/docs/responses/exceptions.md @@ -23,7 +23,7 @@ Exceptions might also be thrown when deserializing the response body - depending This means that a typical `asJson` response specification will result in the body being read as: ```scala mdoc:silent -import sttp.client._ +import sttp.client3._ def asJson[T]: ResponseAs[Either[ResponseException[String, Exception], T], Any] = ??? ``` diff --git a/docs/testing.md b/docs/testing.md index ac2b038e82..51f7ddf053 100644 --- a/docs/testing.md +++ b/docs/testing.md @@ -16,9 +16,9 @@ An empty backend stub can be created using the following ways: Some code which will be reused among following examples: ```scala mdoc -import sttp.client._ +import sttp.client3._ import sttp.model._ -import sttp.client.testing._ +import sttp.client3.testing._ import java.io.File import scala.concurrent.Future import scala.concurrent.ExecutionContext.Implicits.global @@ -122,7 +122,7 @@ basicRequest.get(uri"http://example.org").send(testingBackend) // code wil basicRequest.get(uri"http://example.org").send(testingBackend) // code will be 200 ``` -The `sttp.client.testing` package also contains a utility method to force the body as a string, if the body is not a stream or multipart: +The `sttp.client3.testing` package also contains a utility method to force the body as a string, if the body is not a stream or multipart: ```scala mdoc:compile-only val testingBackend = SttpBackendStub.synchronous @@ -204,7 +204,7 @@ If you actually want a file to be written you can set up the stub like this: ```scala mdoc:compile-only import org.apache.commons.io.FileUtils import cats.effect._ -import sttp.client.impl.cats.implicits._ +import sttp.client3.impl.cats.implicits._ import sttp.monad.MonadAsyncError implicit val cs: ContextShift[IO] = IO.contextShift(scala.concurrent.ExecutionContext.global) diff --git a/docs/websockets.md b/docs/websockets.md index 45a8b906cf..1337aad87d 100644 --- a/docs/websockets.md +++ b/docs/websockets.md @@ -6,7 +6,7 @@ A websocket request will be sent instead of a regular one if the response specif ## Using `WebSocket` -The first possibility is using `sttp.client.ws.WebSocket[F]`, where `F` is the backend-specific effects wrapper, such as `Future` or `IO`. It contains two basic methods, both of which use the `F` effect to return results: +The first possibility is using `sttp.client3.ws.WebSocket[F]`, where `F` is the backend-specific effects wrapper, such as `Future` or `IO`. It contains two basic methods, both of which use the `F` effect to return results: * `def receive: F[WebSocketFrame.Incoming]` which will complete once a message is available, and return the next incoming frame (which can be a data, ping, pong or close) * `def send(f: WebSocketFrame, isContinuation: Boolean = false): F[Unit]`, which sends a message to the websocket. The `WebSocketFrame` companion object contains methods for creating binary/text messages. When using fragmentation, the first message should be sent using `finalFragment = false`, and subsequent messages using `isContinuation = true`. @@ -16,7 +16,7 @@ The `WebSocket` trait also contains other methods for receiving only text/binary The following response specifications which use `WebSocket[F]` are available (the first type parameter of `ResponseAs` specifies the type returned as the response body, the second - the capabilities that the backend is required to support to send the request): ```mdoc:compile-only -import sttp.client._ +import sttp.client3._ def asWebSocket[F[_], T](f: WebSocket[F] => F[T]): ResponseAs[Either[String, T], Effect[F] with WebSockets] = ??? @@ -62,8 +62,8 @@ These methods can be found in corresponding WebSockets classes for given effect ================ ========================================== effect type class name ================ ========================================== -``monix.Task`` ``sttp.client.impl.monix.MonixWebSockets`` -``ZIO`` ``sttp.client.impl.zio.ZioWebSockets`` -``fs2.Stream`` ``sttp.client.impl.fs2.Fs2WebSockets`` +``monix.Task`` ``sttp.client3.impl.monix.MonixWebSockets`` +``ZIO`` ``sttp.client3.impl.zio.ZioWebSockets`` +``fs2.Stream`` ``sttp.client3.impl.fs2.Fs2WebSockets`` ================ ========================================== ``` diff --git a/examples/src/main/scala/sttp/client/examples/GetAndParseJsonAkkaHttpJson4s.scala b/examples/src/main/scala/sttp/client3/examples/GetAndParseJsonAkkaHttpJson4s.scala similarity index 86% rename from examples/src/main/scala/sttp/client/examples/GetAndParseJsonAkkaHttpJson4s.scala rename to examples/src/main/scala/sttp/client3/examples/GetAndParseJsonAkkaHttpJson4s.scala index e0d0170649..ef012e0ce6 100644 --- a/examples/src/main/scala/sttp/client/examples/GetAndParseJsonAkkaHttpJson4s.scala +++ b/examples/src/main/scala/sttp/client3/examples/GetAndParseJsonAkkaHttpJson4s.scala @@ -1,11 +1,11 @@ -package sttp.client.examples +package sttp.client3.examples object GetAndParseJsonAkkaHttpJson4s extends App { import scala.concurrent.Future - import sttp.client._ - import sttp.client.akkahttp._ - import sttp.client.json4s._ + import sttp.client3._ + import sttp.client3.akkahttp._ + import sttp.client3.json4s._ import scala.concurrent.ExecutionContext.Implicits.global diff --git a/examples/src/main/scala/sttp/client/examples/GetAndParseJsonGetRightMonixCirce.scala b/examples/src/main/scala/sttp/client3/examples/GetAndParseJsonGetRightMonixCirce.scala similarity index 80% rename from examples/src/main/scala/sttp/client/examples/GetAndParseJsonGetRightMonixCirce.scala rename to examples/src/main/scala/sttp/client3/examples/GetAndParseJsonGetRightMonixCirce.scala index d62a7c6232..e020be7b61 100644 --- a/examples/src/main/scala/sttp/client/examples/GetAndParseJsonGetRightMonixCirce.scala +++ b/examples/src/main/scala/sttp/client3/examples/GetAndParseJsonGetRightMonixCirce.scala @@ -1,9 +1,9 @@ -package sttp.client.examples +package sttp.client3.examples import io.circe.generic.auto._ -import sttp.client._ -import sttp.client.asynchttpclient.monix.AsyncHttpClientMonixBackend -import sttp.client.circe._ +import sttp.client3._ +import sttp.client3.asynchttpclient.monix.AsyncHttpClientMonixBackend +import sttp.client3.circe._ object GetAndParseJsonGetRightMonixCirce extends App { import monix.execution.Scheduler.Implicits.global diff --git a/examples/src/main/scala/sttp/client/examples/GetAndParseJsonZioCirce.scala b/examples/src/main/scala/sttp/client3/examples/GetAndParseJsonZioCirce.scala similarity index 88% rename from examples/src/main/scala/sttp/client/examples/GetAndParseJsonZioCirce.scala rename to examples/src/main/scala/sttp/client3/examples/GetAndParseJsonZioCirce.scala index d4c25a6b47..8456e7d25b 100644 --- a/examples/src/main/scala/sttp/client/examples/GetAndParseJsonZioCirce.scala +++ b/examples/src/main/scala/sttp/client3/examples/GetAndParseJsonZioCirce.scala @@ -1,8 +1,8 @@ -package sttp.client.examples +package sttp.client3.examples -import sttp.client._ -import sttp.client.circe._ -import sttp.client.asynchttpclient.zio._ +import sttp.client3._ +import sttp.client3.circe._ +import sttp.client3.asynchttpclient.zio._ import io.circe.generic.auto._ import zio._ import zio.console.Console diff --git a/examples/src/main/scala/sttp/client/examples/GetRawResponseBodySynchronous.scala b/examples/src/main/scala/sttp/client3/examples/GetRawResponseBodySynchronous.scala similarity index 89% rename from examples/src/main/scala/sttp/client/examples/GetRawResponseBodySynchronous.scala rename to examples/src/main/scala/sttp/client3/examples/GetRawResponseBodySynchronous.scala index eac72bc9d8..ae9b3419a3 100644 --- a/examples/src/main/scala/sttp/client/examples/GetRawResponseBodySynchronous.scala +++ b/examples/src/main/scala/sttp/client3/examples/GetRawResponseBodySynchronous.scala @@ -1,9 +1,9 @@ -package sttp.client.examples +package sttp.client3.examples import io.circe import io.circe.generic.auto._ -import sttp.client._ -import sttp.client.circe._ +import sttp.client3._ +import sttp.client3.circe._ object GetRawResponseBodySynchronous extends App { case class HttpBinResponse(origin: String, headers: Map[String, String]) diff --git a/examples/src/main/scala/sttp/client/examples/LogRequestsSlf4j.scala b/examples/src/main/scala/sttp/client3/examples/LogRequestsSlf4j.scala similarity index 81% rename from examples/src/main/scala/sttp/client/examples/LogRequestsSlf4j.scala rename to examples/src/main/scala/sttp/client3/examples/LogRequestsSlf4j.scala index 86dfc24aff..14ec83db82 100644 --- a/examples/src/main/scala/sttp/client/examples/LogRequestsSlf4j.scala +++ b/examples/src/main/scala/sttp/client3/examples/LogRequestsSlf4j.scala @@ -1,9 +1,9 @@ -package sttp.client.examples +package sttp.client3.examples import io.circe.generic.auto._ -import sttp.client._ -import sttp.client.circe._ -import sttp.client.logging.slf4j.Slf4jLoggingBackend +import sttp.client3._ +import sttp.client3.circe._ +import sttp.client3.logging.slf4j.Slf4jLoggingBackend object LogRequestsSlf4j extends App { case class HttpBinResponse(origin: String, headers: Map[String, String]) diff --git a/examples/src/main/scala/sttp/client/examples/PostFormSynchronous.scala b/examples/src/main/scala/sttp/client3/examples/PostFormSynchronous.scala similarity index 89% rename from examples/src/main/scala/sttp/client/examples/PostFormSynchronous.scala rename to examples/src/main/scala/sttp/client3/examples/PostFormSynchronous.scala index 722d4510be..7b9b3f5695 100644 --- a/examples/src/main/scala/sttp/client/examples/PostFormSynchronous.scala +++ b/examples/src/main/scala/sttp/client3/examples/PostFormSynchronous.scala @@ -1,7 +1,7 @@ -package sttp.client.examples +package sttp.client3.examples object PostFormSynchronous extends App { - import sttp.client._ + import sttp.client3._ val signup = Some("yes") diff --git a/examples/src/main/scala/sttp/client/examples/PostSerializeJsonMonixAsyncHttpClientCirce.scala b/examples/src/main/scala/sttp/client3/examples/PostSerializeJsonMonixAsyncHttpClientCirce.scala similarity index 81% rename from examples/src/main/scala/sttp/client/examples/PostSerializeJsonMonixAsyncHttpClientCirce.scala rename to examples/src/main/scala/sttp/client3/examples/PostSerializeJsonMonixAsyncHttpClientCirce.scala index 0b216dc168..1a7609acff 100644 --- a/examples/src/main/scala/sttp/client/examples/PostSerializeJsonMonixAsyncHttpClientCirce.scala +++ b/examples/src/main/scala/sttp/client3/examples/PostSerializeJsonMonixAsyncHttpClientCirce.scala @@ -1,9 +1,9 @@ -package sttp.client.examples +package sttp.client3.examples object PostSerializeJsonMonixAsyncHttpClientCirce extends App { - import sttp.client._ - import sttp.client.circe._ - import sttp.client.asynchttpclient.monix._ + import sttp.client3._ + import sttp.client3.circe._ + import sttp.client3.asynchttpclient.monix._ import io.circe.generic.auto._ import monix.eval.Task diff --git a/examples/src/main/scala/sttp/client/examples/RetryZio.scala b/examples/src/main/scala/sttp/client3/examples/RetryZio.scala similarity index 86% rename from examples/src/main/scala/sttp/client/examples/RetryZio.scala rename to examples/src/main/scala/sttp/client3/examples/RetryZio.scala index 168889307a..379426510b 100644 --- a/examples/src/main/scala/sttp/client/examples/RetryZio.scala +++ b/examples/src/main/scala/sttp/client3/examples/RetryZio.scala @@ -1,7 +1,7 @@ -package sttp.client.examples +package sttp.client3.examples -import sttp.client._ -import sttp.client.asynchttpclient.zio.AsyncHttpClientZioBackend +import sttp.client3._ +import sttp.client3.asynchttpclient.zio.AsyncHttpClientZioBackend import zio.{ExitCode, Schedule, ZIO} import zio.clock.Clock import zio.duration._ diff --git a/examples/src/main/scala/sttp/client/examples/StreamFs2.scala b/examples/src/main/scala/sttp/client3/examples/StreamFs2.scala similarity index 91% rename from examples/src/main/scala/sttp/client/examples/StreamFs2.scala rename to examples/src/main/scala/sttp/client3/examples/StreamFs2.scala index 0f04fa1888..4701f68896 100644 --- a/examples/src/main/scala/sttp/client/examples/StreamFs2.scala +++ b/examples/src/main/scala/sttp/client3/examples/StreamFs2.scala @@ -1,7 +1,7 @@ -package sttp.client.examples +package sttp.client3.examples -import sttp.client._ -import sttp.client.asynchttpclient.fs2.AsyncHttpClientFs2Backend +import sttp.client3._ +import sttp.client3.asynchttpclient.fs2.AsyncHttpClientFs2Backend import cats.effect.{Blocker, ContextShift, IO} import cats.instances.string._ import fs2.{Stream, text} diff --git a/examples/src/main/scala/sttp/client/examples/StreamZio.scala b/examples/src/main/scala/sttp/client3/examples/StreamZio.scala similarity index 87% rename from examples/src/main/scala/sttp/client/examples/StreamZio.scala rename to examples/src/main/scala/sttp/client3/examples/StreamZio.scala index 1d80ce060b..c4f373ee32 100644 --- a/examples/src/main/scala/sttp/client/examples/StreamZio.scala +++ b/examples/src/main/scala/sttp/client3/examples/StreamZio.scala @@ -1,8 +1,8 @@ -package sttp.client.examples +package sttp.client3.examples import sttp.capabilities.zio.ZioStreams -import sttp.client._ -import sttp.client.asynchttpclient.zio.{AsyncHttpClientZioBackend, SttpClient, send} +import sttp.client3._ +import sttp.client3.asynchttpclient.zio.{AsyncHttpClientZioBackend, SttpClient, send} import zio._ import zio.console._ import zio.stream._ diff --git a/examples/src/main/scala/sttp/client/examples/TestEndpointMultipleQueryParameters.scala b/examples/src/main/scala/sttp/client3/examples/TestEndpointMultipleQueryParameters.scala similarity index 88% rename from examples/src/main/scala/sttp/client/examples/TestEndpointMultipleQueryParameters.scala rename to examples/src/main/scala/sttp/client3/examples/TestEndpointMultipleQueryParameters.scala index 3bca204e3a..8f59ca552c 100644 --- a/examples/src/main/scala/sttp/client/examples/TestEndpointMultipleQueryParameters.scala +++ b/examples/src/main/scala/sttp/client3/examples/TestEndpointMultipleQueryParameters.scala @@ -1,8 +1,8 @@ -package sttp.client.examples +package sttp.client3.examples object TestEndpointMultipleQueryParameters extends App { - import sttp.client._ - import sttp.client.testing._ + import sttp.client3._ + import sttp.client3.testing._ val backend = SttpBackendStub.synchronous .whenRequestMatches(_.uri.paramsMap.contains("filter")) diff --git a/examples/src/main/scala/sttp/client/examples/WebSocketAkka.scala b/examples/src/main/scala/sttp/client3/examples/WebSocketAkka.scala similarity index 86% rename from examples/src/main/scala/sttp/client/examples/WebSocketAkka.scala rename to examples/src/main/scala/sttp/client3/examples/WebSocketAkka.scala index 35d49b8568..5fd61477f1 100644 --- a/examples/src/main/scala/sttp/client/examples/WebSocketAkka.scala +++ b/examples/src/main/scala/sttp/client3/examples/WebSocketAkka.scala @@ -1,7 +1,7 @@ -package sttp.client.examples +package sttp.client3.examples -import sttp.client._ -import sttp.client.akkahttp.AkkaHttpBackend +import sttp.client3._ +import sttp.client3.akkahttp.AkkaHttpBackend import sttp.ws.WebSocket import scala.concurrent.ExecutionContext.Implicits.global diff --git a/examples/src/main/scala/sttp/client/examples/WebSocketMonix.scala b/examples/src/main/scala/sttp/client3/examples/WebSocketMonix.scala similarity index 83% rename from examples/src/main/scala/sttp/client/examples/WebSocketMonix.scala rename to examples/src/main/scala/sttp/client3/examples/WebSocketMonix.scala index e65929ac69..bf6d70dde5 100644 --- a/examples/src/main/scala/sttp/client/examples/WebSocketMonix.scala +++ b/examples/src/main/scala/sttp/client3/examples/WebSocketMonix.scala @@ -1,8 +1,8 @@ -package sttp.client.examples +package sttp.client3.examples import monix.eval.Task -import sttp.client._ -import sttp.client.asynchttpclient.monix.AsyncHttpClientMonixBackend +import sttp.client3._ +import sttp.client3.asynchttpclient.monix.AsyncHttpClientMonixBackend import sttp.ws.WebSocket object WebSocketMonix extends App { diff --git a/examples/src/main/scala/sttp/client/examples/WebSocketStreamFs2.scala b/examples/src/main/scala/sttp/client3/examples/WebSocketStreamFs2.scala similarity index 90% rename from examples/src/main/scala/sttp/client/examples/WebSocketStreamFs2.scala rename to examples/src/main/scala/sttp/client3/examples/WebSocketStreamFs2.scala index a5eea9eed3..bdc5b384ba 100644 --- a/examples/src/main/scala/sttp/client/examples/WebSocketStreamFs2.scala +++ b/examples/src/main/scala/sttp/client3/examples/WebSocketStreamFs2.scala @@ -1,10 +1,10 @@ -package sttp.client.examples +package sttp.client3.examples import cats.effect.{Blocker, ContextShift, IO} import fs2._ import sttp.capabilities.fs2.Fs2Streams -import sttp.client._ -import sttp.client.asynchttpclient.fs2.AsyncHttpClientFs2Backend +import sttp.client3._ +import sttp.client3.asynchttpclient.fs2.AsyncHttpClientFs2Backend import sttp.ws.WebSocketFrame import scala.concurrent.ExecutionContext.global diff --git a/examples/src/main/scala/sttp/client/examples/WebSocketTesting.scala b/examples/src/main/scala/sttp/client3/examples/WebSocketTesting.scala similarity index 89% rename from examples/src/main/scala/sttp/client/examples/WebSocketTesting.scala rename to examples/src/main/scala/sttp/client3/examples/WebSocketTesting.scala index 6de4c754ff..ebd340b128 100644 --- a/examples/src/main/scala/sttp/client/examples/WebSocketTesting.scala +++ b/examples/src/main/scala/sttp/client3/examples/WebSocketTesting.scala @@ -1,11 +1,11 @@ -package sttp.client.examples +package sttp.client3.examples import monix.eval.Task import sttp.capabilities.WebSockets import sttp.capabilities.monix.MonixStreams -import sttp.client._ -import sttp.client.asynchttpclient.monix.AsyncHttpClientMonixBackend -import sttp.client.testing.SttpBackendStub +import sttp.client3._ +import sttp.client3.asynchttpclient.monix.AsyncHttpClientMonixBackend +import sttp.client3.testing.SttpBackendStub import sttp.model.StatusCode import sttp.ws.{WebSocket, WebSocketFrame} import sttp.ws.testing.WebSocketStub diff --git a/examples/src/main/scala/sttp/client/examples/WebSocketZio.scala b/examples/src/main/scala/sttp/client3/examples/WebSocketZio.scala similarity index 90% rename from examples/src/main/scala/sttp/client/examples/WebSocketZio.scala rename to examples/src/main/scala/sttp/client3/examples/WebSocketZio.scala index 61209b270a..e5ff2cd2a4 100644 --- a/examples/src/main/scala/sttp/client/examples/WebSocketZio.scala +++ b/examples/src/main/scala/sttp/client3/examples/WebSocketZio.scala @@ -1,7 +1,7 @@ -package sttp.client.examples +package sttp.client3.examples -import sttp.client._ -import sttp.client.asynchttpclient.zio._ +import sttp.client3._ +import sttp.client3.asynchttpclient.zio._ import sttp.ws.WebSocket import zio._ import zio.console.Console diff --git a/finagle-backend/src/main/scala/sttp/client/finagle/FinagleBackend.scala b/finagle-backend/src/main/scala/sttp/client3/finagle/FinagleBackend.scala similarity index 96% rename from finagle-backend/src/main/scala/sttp/client/finagle/FinagleBackend.scala rename to finagle-backend/src/main/scala/sttp/client3/finagle/FinagleBackend.scala index e9e5b0ef5e..b8a6a31cad 100644 --- a/finagle-backend/src/main/scala/sttp/client/finagle/FinagleBackend.scala +++ b/finagle-backend/src/main/scala/sttp/client3/finagle/FinagleBackend.scala @@ -1,4 +1,4 @@ -package sttp.client.finagle +package sttp.client3.finagle import com.twitter.finagle.Http.Client import com.twitter.finagle.http.{ @@ -15,10 +15,10 @@ import com.twitter.io.Buf.{ByteArray, ByteBuffer} import com.twitter.util import com.twitter.util.{Duration, Future => TFuture} import sttp.capabilities.Effect -import sttp.client.internal.{BodyFromResponseAs, FileHelpers, SttpFile} -import sttp.client.testing.SttpBackendStub -import sttp.client.ws.{GotAWebSocketException, NotAWebSocketException} -import sttp.client.{ +import sttp.client3.internal.{BodyFromResponseAs, FileHelpers, SttpFile} +import sttp.client3.testing.SttpBackendStub +import sttp.client3.ws.{GotAWebSocketException, NotAWebSocketException} +import sttp.client3.{ ByteArrayBody, ByteBufferBody, FileBody, @@ -57,7 +57,7 @@ class FinagleBackend(client: Option[Client] = None) extends SttpBackend[TFuture, val body = bodyFromResponseAs(request.response, responseMetadata, Left(fResponse)) service .close() - .flatMap(_ => body.map(sttp.client.Response(_, code, statusText, headers, Nil, request.onlyMetadata))) + .flatMap(_ => body.map(sttp.client3.Response(_, code, statusText, headers, Nil, request.onlyMetadata))) } .rescue { case e: Exception => service.close().flatMap(_ => TFuture.exception(e)) diff --git a/finagle-backend/src/test/scala/sttp/client/finagle/FinagleBackendTest.scala b/finagle-backend/src/test/scala/sttp/client3/finagle/FinagleBackendTest.scala similarity index 86% rename from finagle-backend/src/test/scala/sttp/client/finagle/FinagleBackendTest.scala rename to finagle-backend/src/test/scala/sttp/client3/finagle/FinagleBackendTest.scala index 74c3e07712..fa8f4c4696 100644 --- a/finagle-backend/src/test/scala/sttp/client/finagle/FinagleBackendTest.scala +++ b/finagle-backend/src/test/scala/sttp/client3/finagle/FinagleBackendTest.scala @@ -1,8 +1,8 @@ -package sttp.client.finagle +package sttp.client3.finagle -import sttp.client.SttpBackend +import sttp.client3.SttpBackend import com.twitter.util.{Return, Throw, Future => TFuture} -import sttp.client.testing.{ConvertToFuture, HttpTest} +import sttp.client3.testing.{ConvertToFuture, HttpTest} import scala.concurrent.{Future, Promise} diff --git a/generated-docs/out/backends/akka.md b/generated-docs/out/backends/akka.md index 450e792117..dd9d6c83a2 100644 --- a/generated-docs/out/backends/akka.md +++ b/generated-docs/out/backends/akka.md @@ -3,7 +3,7 @@ This backend is based on [akka-http](http://doc.akka.io/docs/akka-http/current/scala/http/). To use, add the following dependency to your project: ``` -"com.softwaremill.sttp.client" %% "akka-http-backend" % "3.0.0-RC3" +"com.softwaremill.sttp.client3" %% "akka-http-backend" % "3.0.0-RC3" ``` A fully **asynchronous** backend. Uses the `Future` effect to return responses. There are also [other `Future`-based backends](future.md), which don't depend on Akka. @@ -17,27 +17,27 @@ Note that you'll also need an explicit dependency on akka-streams, as akka-http Next you'll need to add create the backend instance: ```scala -import sttp.client.akkahttp._ +import sttp.client3.akkahttp._ val backend = AkkaHttpBackend() ``` or, if you'd like to use an existing actor system: ```scala -import sttp.client.akkahttp._ +import sttp.client3.akkahttp._ import akka.actor.ActorSystem val actorSystem: ActorSystem = ??? val backend = AkkaHttpBackend.usingActorSystem(actorSystem) ``` -This backend supports sending and receiving [akka-streams](http://doc.akka.io/docs/akka/current/scala/stream/index.html) streams. The streams capability is represented as `sttp.client.akkahttp.AkkaStreams`. +This backend supports sending and receiving [akka-streams](http://doc.akka.io/docs/akka/current/scala/stream/index.html) streams. The streams capability is represented as `sttp.client3.akkahttp.AkkaStreams`. To set the request body as a stream: ```scala import sttp.capabilities.akka.AkkaStreams -import sttp.client._ +import sttp.client3._ import akka.stream.scaladsl.Source import akka.util.ByteString @@ -54,8 +54,8 @@ To receive the response body as a stream: ```scala import scala.concurrent.Future import sttp.capabilities.akka.AkkaStreams -import sttp.client._ -import sttp.client.akkahttp.AkkaHttpBackend +import sttp.client3._ +import sttp.client3.akkahttp.AkkaHttpBackend import akka.stream.scaladsl.Source import akka.util.ByteString @@ -80,7 +80,7 @@ That way, you can "mock" a server that the backend will talk to, without startin If your application provides a client library for its dependants to use, this is a great way to ensure that the client actually matches the routes exposed by your application: ```scala -import sttp.client.akkahttp._ +import sttp.client3.akkahttp._ import akka.http.scaladsl.server.Route import akka.actor.ActorSystem diff --git a/generated-docs/out/backends/catseffect.md b/generated-docs/out/backends/catseffect.md index 192a60a16b..4ff8e7e9f0 100644 --- a/generated-docs/out/backends/catseffect.md +++ b/generated-docs/out/backends/catseffect.md @@ -5,14 +5,14 @@ The [Cats Effect](https://github.com/typelevel/cats-effect) backend is **asynchr To use, add the following dependency to your project: ```scala -"com.softwaremill.sttp.client" %% "async-http-client-backend-cats" % "3.0.0-RC3" +"com.softwaremill.sttp.client3" %% "async-http-client-backend-cats" % "3.0.0-RC3" ``` You'll need the following imports and implicits to create the backend: ```scala -import sttp.client._ -import sttp.client.asynchttpclient.cats.AsyncHttpClientCatsBackend +import sttp.client3._ +import sttp.client3.asynchttpclient.cats.AsyncHttpClientCatsBackend import cats.effect._ // an implicit `cats.effect.ContextShift` in required to create the backend; here, for `cats.effect.IO`: diff --git a/generated-docs/out/backends/finagle.md b/generated-docs/out/backends/finagle.md index 7126cde0f4..dfc7a19033 100644 --- a/generated-docs/out/backends/finagle.md +++ b/generated-docs/out/backends/finagle.md @@ -3,13 +3,13 @@ To use, add the following dependency to your project: ``` -"com.softwaremill.sttp.client" %% "finagle-backend" % "3.0.0-RC3" +"com.softwaremill.sttp.client3" %% "finagle-backend" % "3.0.0-RC3" ``` Next you'll need to add an implicit value: ```scala -import sttp.client.finagle.FinagleBackend +import sttp.client3.finagle.FinagleBackend val backend = FinagleBackend() ``` diff --git a/generated-docs/out/backends/fs2.md b/generated-docs/out/backends/fs2.md index 7f86a23510..6f1493edc1 100644 --- a/generated-docs/out/backends/fs2.md +++ b/generated-docs/out/backends/fs2.md @@ -7,15 +7,15 @@ The [fs2](https://github.com/functional-streams-for-scala/fs2) backend is **asyn To use, add the following dependency to your project: ```scala -"com.softwaremill.sttp.client" %% "async-http-client-backend-fs2" % "3.0.0-RC3" +"com.softwaremill.sttp.client3" %% "async-http-client-backend-fs2" % "3.0.0-RC3" ``` And some imports: ```scala -import sttp.client.asynchttpclient.fs2.AsyncHttpClientFs2Backend +import sttp.client3.asynchttpclient.fs2.AsyncHttpClientFs2Backend import cats.effect._ -import sttp.client._ +import sttp.client3._ // an implicit `cats.effect.ContextShift` is required to create a concurrent instance for `cats.effect.IO`, // as well as a `cats.effect.Blocker` instance. Note that you'll probably want to use a different thread @@ -76,15 +76,15 @@ val backend = AsyncHttpClientFs2Backend.usingClient[IO](asyncHttpClient, blocker To use, add the following dependency to your project: ``` -"com.softwaremill.sttp.client" %% "httpclient-backend-fs2" % "3.0.0-RC3" +"com.softwaremill.sttp.client3" %% "httpclient-backend-fs2" % "3.0.0-RC3" ``` And some imports: ```scala -import sttp.client.httpclient.fs2.HttpClientFs2Backend +import sttp.client3.httpclient.fs2.HttpClientFs2Backend import cats.effect._ -import sttp.client._ +import sttp.client3._ // an implicit `cats.effect.ContextShift` is required to create a concurrent instance for `cats.effect.IO`, // as well as a `cats.effect.Blocker` instance. Note that you'll probably want to use a different thread @@ -96,7 +96,7 @@ val blocker = Blocker.liftExecutionContext(scala.concurrent.ExecutionContext.glo Create the backend using: ```scala -import sttp.client.httpclient.fs2.HttpClientFs2Backend +import sttp.client3.httpclient.fs2.HttpClientFs2Backend HttpClientFs2Backend[IO](blocker).flatMap { backend => ??? } ``` @@ -118,14 +118,14 @@ This backend is based on the built-in `java.net.http.HttpClient` available from ## Streaming -The fs2 backend supports streaming for any instance of the `cats.effect.Effect` typeclass, such as `cats.effect.IO`. If `IO` is used then the type of supported streams is `fs2.Stream[IO, Byte]`. The streams capability is represented as `sttp.client.fs2.Fs2Streams`. +The fs2 backend supports streaming for any instance of the `cats.effect.Effect` typeclass, such as `cats.effect.IO`. If `IO` is used then the type of supported streams is `fs2.Stream[IO, Byte]`. The streams capability is represented as `sttp.client3.fs2.Fs2Streams`. Requests can be sent with a streaming body like this: ```scala import sttp.capabilities.fs2.Fs2Streams -import sttp.client._ -import sttp.client.asynchttpclient.fs2.AsyncHttpClientFs2Backend +import sttp.client3._ +import sttp.client3.asynchttpclient.fs2.AsyncHttpClientFs2Backend import fs2.Stream val effect = AsyncHttpClientFs2Backend[IO](blocker).flatMap { backend => @@ -142,7 +142,7 @@ Responses can also be streamed: ```scala import sttp.capabilities.fs2.Fs2Streams -import sttp.client.asynchttpclient.fs2.AsyncHttpClientFs2Backend +import sttp.client3.asynchttpclient.fs2.AsyncHttpClientFs2Backend import fs2.Stream import scala.concurrent.duration.Duration diff --git a/generated-docs/out/backends/future.md b/generated-docs/out/backends/future.md index cc9bdd4420..bb028a4357 100644 --- a/generated-docs/out/backends/future.md +++ b/generated-docs/out/backends/future.md @@ -20,14 +20,14 @@ Class Supported stream type To use, add the following dependency to your project: ```scala -"com.softwaremill.sttp.client" %% "async-http-client-backend-future" % "3.0.0-RC3" +"com.softwaremill.sttp.client3" %% "async-http-client-backend-future" % "3.0.0-RC3" ``` And some imports: ```scala -import sttp.client._ -import sttp.client.asynchttpclient.future.AsyncHttpClientFutureBackend +import sttp.client3._ +import sttp.client3.asynchttpclient.future.AsyncHttpClientFutureBackend ``` This backend depends on [async-http-client](https://github.com/AsyncHttpClient/async-http-client) and uses [Netty](http://netty.io) behind the scenes. @@ -71,13 +71,13 @@ val backend = AsyncHttpClientFutureBackend.usingClient(asyncHttpClient) To use, add the following dependency to your project: ```scala -"com.softwaremill.sttp.client" %% "okhttp-backend" % "3.0.0-RC3" +"com.softwaremill.sttp.client3" %% "okhttp-backend" % "3.0.0-RC3" ``` and some imports: ```scala -import sttp.client.okhttp.OkHttpFutureBackend +import sttp.client3.okhttp.OkHttpFutureBackend import scala.concurrent.ExecutionContext.Implicits.global ``` @@ -103,13 +103,13 @@ This backend depends on [OkHttp](http://square.github.io/okhttp/) and fully supp To use, add the following dependency to your project: ``` -"com.softwaremill.sttp.client" %% "httpclient-backend" % "3.0.0-RC3" +"com.softwaremill.sttp.client3" %% "httpclient-backend" % "3.0.0-RC3" ``` and some imports: ```scala -import sttp.client.httpclient.HttpClientFutureBackend +import sttp.client3.httpclient.HttpClientFutureBackend import scala.concurrent.ExecutionContext.Implicits.global ``` diff --git a/generated-docs/out/backends/http4s.md b/generated-docs/out/backends/http4s.md index 1f63e1731a..5e3a29dd38 100644 --- a/generated-docs/out/backends/http4s.md +++ b/generated-docs/out/backends/http4s.md @@ -3,14 +3,14 @@ This backend is based on [http4s](https://http4s.org) (blaze client) and is **asynchronous**. To use, add the following dependency to your project: ``` -"com.softwaremill.sttp.client" %% "http4s-backend" % "3.0.0-RC3" +"com.softwaremill.sttp.client3" %% "http4s-backend" % "3.0.0-RC3" ``` Add some imports as well: ```scala import cats.effect._ -import sttp.client.http4s._ +import sttp.client3.http4s._ import scala.concurrent._ // an implicit `cats.effect.ContextShift` is required to create an instance of `cats.effect.Concurrent` diff --git a/generated-docs/out/backends/javascript/fetch.md b/generated-docs/out/backends/javascript/fetch.md index b9a9016c49..e6fee1affb 100644 --- a/generated-docs/out/backends/javascript/fetch.md +++ b/generated-docs/out/backends/javascript/fetch.md @@ -5,7 +5,7 @@ A JavaScript backend implemented using the [Fetch API](https://developer.mozilla This is the default backend, available in the main jar for JS. To use, add the following dependency to your project: ``` -"com.softwaremill.sttp.client" %%% "core" % "3.0.0-RC3" +"com.softwaremill.sttp.client3" %%% "core" % "3.0.0-RC3" ``` And create the backend instance: @@ -48,14 +48,14 @@ Streaming support is provided via `FetchMonixBackend`. Note that streaming suppo To use, add the following dependency to your project: ``` -"com.softwaremill.sttp.client" %%% "monix" % "3.0.0-RC3" +"com.softwaremill.sttp.client3" %%% "monix" % "3.0.0-RC3" ``` An example of streaming a response: ```scala -import sttp.client._ -import sttp.client.impl.monix._ +import sttp.client3._ +import sttp.client3.impl.monix._ import java.nio.ByteBuffer import monix.eval.Task diff --git a/generated-docs/out/backends/monix.md b/generated-docs/out/backends/monix.md index 895874467a..ee6cf5c68c 100644 --- a/generated-docs/out/backends/monix.md +++ b/generated-docs/out/backends/monix.md @@ -7,7 +7,7 @@ There are several backend implementations which are `monix.eval.Task`-based. The To use, add the following dependency to your project: ```scala -"com.softwaremill.sttp.client" %% "async-http-client-backend-monix" % "3.0.0-RC3" +"com.softwaremill.sttp.client3" %% "async-http-client-backend-monix" % "3.0.0-RC3" ``` This backend depends on [async-http-client](https://github.com/AsyncHttpClient/async-http-client), uses [Netty](http://netty.io) behind the scenes and supports effect cancellation. @@ -20,8 +20,8 @@ Next you'll need to define a backend instance as an implicit value. This can be A non-comprehensive summary of how the backend can be created is as follows: ```scala -import sttp.client.asynchttpclient.monix.AsyncHttpClientMonixBackend -import sttp.client._ +import sttp.client3.asynchttpclient.monix.AsyncHttpClientMonixBackend +import sttp.client3._ AsyncHttpClientMonixBackend().flatMap { backend => ??? } @@ -50,13 +50,13 @@ val backend = AsyncHttpClientMonixBackend.usingClient(asyncHttpClient) To use, add the following dependency to your project: ```scala -"com.softwaremill.sttp.client" %% "okhttp-backend-monix" % "3.0.0-RC3" +"com.softwaremill.sttp.client3" %% "okhttp-backend-monix" % "3.0.0-RC3" ``` Create the backend using: ```scala -import sttp.client.okhttp.monix.OkHttpMonixBackend +import sttp.client3.okhttp.monix.OkHttpMonixBackend OkHttpMonixBackend().flatMap { backend => ??? } @@ -76,13 +76,13 @@ This backend depends on [OkHttp](http://square.github.io/okhttp/) and fully supp To use, add the following dependency to your project: ``` -"com.softwaremill.sttp.client" %% "httpclient-backend-monix" % "3.0.0-RC3" +"com.softwaremill.sttp.client3" %% "httpclient-backend-monix" % "3.0.0-RC3" ``` Create the backend using: ```scala -import sttp.client.httpclient.monix.HttpClientMonixBackend +import sttp.client3.httpclient.monix.HttpClientMonixBackend HttpClientMonixBackend().flatMap { backend => ??? } @@ -99,12 +99,12 @@ This backend is based on the built-in `java.net.http.HttpClient` available from ## Streaming -The Monix backends support streaming. The streams capability is represented as `sttp.client.impl.monix.MonixStreams`. The type of supported streams in this case is `Observable[ByteBuffer]`. That is, you can set such an observable as a request body (using the async-http-client backend as an example, but any of the above backends can be used): +The Monix backends support streaming. The streams capability is represented as `sttp.client3.impl.monix.MonixStreams`. The type of supported streams in this case is `Observable[ByteBuffer]`. That is, you can set such an observable as a request body (using the async-http-client backend as an example, but any of the above backends can be used): ```scala import sttp.capabilities.monix.MonixStreams -import sttp.client._ -import sttp.client.asynchttpclient.monix._ +import sttp.client3._ +import sttp.client3.asynchttpclient.monix._ import java.nio.ByteBuffer import monix.reactive.Observable @@ -123,8 +123,8 @@ And receive responses as an observable stream: ```scala import sttp.capabilities.monix.MonixStreams -import sttp.client._ -import sttp.client.asynchttpclient.monix._ +import sttp.client3._ +import sttp.client3.asynchttpclient.monix._ import java.nio.ByteBuffer import monix.eval.Task diff --git a/generated-docs/out/backends/native/curl.md b/generated-docs/out/backends/native/curl.md index fade8c0d7d..fd9bf6a51b 100644 --- a/generated-docs/out/backends/native/curl.md +++ b/generated-docs/out/backends/native/curl.md @@ -5,7 +5,7 @@ A Scala Native backend implemented using [Curl](https://github.com/curl/curl/blo To use, add the following dependency to your project: ``` -"com.softwaremill.sttp.client" %%% "core" % "3.0.0-RC3" +"com.softwaremill.sttp.client3" %%% "core" % "3.0.0-RC3" ``` and initialize one of the backends: diff --git a/generated-docs/out/backends/scalaz.md b/generated-docs/out/backends/scalaz.md index c728e954fb..f398cd2486 100644 --- a/generated-docs/out/backends/scalaz.md +++ b/generated-docs/out/backends/scalaz.md @@ -5,7 +5,7 @@ The [Scalaz](https://github.com/scalaz/scalaz) backend is **asynchronous**. Send To use, add the following dependency to your project: ```scala -"com.softwaremill.sttp.client" %% "async-http-client-backend-scalaz" % "3.0.0-RC3" +"com.softwaremill.sttp.client3" %% "async-http-client-backend-scalaz" % "3.0.0-RC3" ``` This backend depends on [async-http-client](https://github.com/AsyncHttpClient/async-http-client) and uses [Netty](http://netty.io) behind the scenes. @@ -13,8 +13,8 @@ This backend depends on [async-http-client](https://github.com/AsyncHttpClient/a Next you'll need to add an implicit value: ```scala -import sttp.client._ -import sttp.client.asynchttpclient.scalaz.AsyncHttpClientScalazBackend +import sttp.client3._ +import sttp.client3.asynchttpclient.scalaz.AsyncHttpClientScalazBackend AsyncHttpClientScalazBackend().flatMap { backend => ??? } diff --git a/generated-docs/out/backends/synchronous.md b/generated-docs/out/backends/synchronous.md index 45f51a752f..ff722629a7 100644 --- a/generated-docs/out/backends/synchronous.md +++ b/generated-docs/out/backends/synchronous.md @@ -1,6 +1,6 @@ # Synchronous backends -There are several synchronous backend implementations. Sending a request using these backends is a blocking operation, and results in a `sttp.client.Response[T]`. +There are several synchronous backend implementations. Sending a request using these backends is a blocking operation, and results in a `sttp.client3.Response[T]`. ## Using HttpURLConnection @@ -9,7 +9,7 @@ The default **synchronous** backend, available in the main jar for the JVM. To use, add an implicit value: ```scala -import sttp.client._ +import sttp.client3._ val backend = HttpURLConnectionBackend() ``` @@ -20,13 +20,13 @@ This backend works with all Scala versions. A Dotty build is available as well. To use, add the following dependency to your project: ``` -"com.softwaremill.sttp.client" %% "okhttp-backend" % "3.0.0-RC3" +"com.softwaremill.sttp.client3" %% "okhttp-backend" % "3.0.0-RC3" ``` Create the backend using: ```scala -import sttp.client.okhttp.OkHttpSyncBackend +import sttp.client3.okhttp.OkHttpSyncBackend val backend = OkHttpSyncBackend() ``` @@ -34,7 +34,7 @@ val backend = OkHttpSyncBackend() or, if you'd like to instantiate the OkHttpClient yourself: ```scala -import sttp.client.okhttp.OkHttpSyncBackend +import sttp.client3.okhttp.OkHttpSyncBackend import okhttp3._ val okHttpClient: OkHttpClient = ??? @@ -48,13 +48,13 @@ This backend depends on [OkHttp](http://square.github.io/okhttp/) and fully supp To use, add the following dependency to your project: ``` -"com.softwaremill.sttp.client" %% "httpclient-backend" % "3.0.0-RC3" +"com.softwaremill.sttp.client3" %% "httpclient-backend" % "3.0.0-RC3" ``` Create the backend using: ```scala -import sttp.client.httpclient.HttpClientSyncBackend +import sttp.client3.httpclient.HttpClientSyncBackend val backend = HttpClientSyncBackend() ``` @@ -62,7 +62,7 @@ val backend = HttpClientSyncBackend() or, if you'd like to instantiate the HttpClient yourself: ```scala -import sttp.client.httpclient.HttpClientSyncBackend +import sttp.client3.httpclient.HttpClientSyncBackend import java.net.http.HttpClient val httpClient: HttpClient = ??? val backend = HttpClientSyncBackend.usingClient(httpClient) diff --git a/generated-docs/out/backends/wrappers/custom.md b/generated-docs/out/backends/wrappers/custom.md index 793329cf04..e3be4f7d42 100644 --- a/generated-docs/out/backends/wrappers/custom.md +++ b/generated-docs/out/backends/wrappers/custom.md @@ -20,7 +20,7 @@ Backends, or backend wrappers can use tags e.g. for logging, passing a metric na ## Listener backend -The `sttp.client.listener.ListenerBackend` can make it easier to create backend wrappers which need to be notified about request lifecycle events: when a request is started, and when it completes either successfully or with an exception. This is possible by implementing a `sttp.client.listener.RequestListener`. This is how e.g. the [slf4j backend](logging.md) is implemented. +The `sttp.client3.listener.ListenerBackend` can make it easier to create backend wrappers which need to be notified about request lifecycle events: when a request is started, and when it completes either successfully or with an exception. This is possible by implementing a `sttp.client3.listener.RequestListener`. This is how e.g. the [slf4j backend](logging.md) is implemented. A request listener can associate a value with a request, which will then be passed to the request completion notification methods. @@ -36,7 +36,7 @@ For example: ```scala import sttp.capabilities.Effect -import sttp.client._ +import sttp.client3._ import sttp.monad.MonadError class MyWrapper[F[_], P] private (delegate: SttpBackend[F, P]) @@ -71,9 +71,9 @@ metrics for completed requests and wraps any `Future`-based backend: ```scala import sttp.capabilities.Effect -import sttp.client._ +import sttp.client3._ import sttp.monad.MonadError -import sttp.client.akkahttp._ +import sttp.client3.akkahttp._ import scala.concurrent.Future import scala.concurrent.ExecutionContext.Implicits.global import scala.util._ @@ -138,7 +138,7 @@ In some cases it's possible to implement a generic retry mechanism; such a mecha ```scala import sttp.capabilities.Effect -import sttp.client._ +import sttp.client3._ import sttp.monad.MonadError class RetryingBackend[F[_], P]( @@ -185,7 +185,7 @@ Below is an example on how to implement a backend wrapper, which integrates with ```scala import io.github.resilience4j.circuitbreaker.{CallNotPermittedException, CircuitBreaker} import sttp.capabilities.Effect -import sttp.client.{Request, Response, SttpBackend} +import sttp.client3.{Request, Response, SttpBackend} import sttp.monad.MonadError import java.util.concurrent.TimeUnit @@ -245,7 +245,7 @@ Below is an example on how to implement a backend wrapper, which integrates with import io.github.resilience4j.ratelimiter.RateLimiter import sttp.capabilities.Effect import sttp.monad.MonadError -import sttp.client.{Request, Response, SttpBackend} +import sttp.client3.{Request, Response, SttpBackend} class RateLimitingSttpBackend[F[_], P]( rateLimiter: RateLimiter, @@ -285,14 +285,14 @@ object RateLimitingSttpBackend { Implementing a new backend is made easy as the tests are published in the `core` jar file under the `tests` classifier. Simply add the follow dependencies to your `build.sbt`: ``` -"com.softwaremill.sttp.client" %% "core" % "3.0.0-RC3" % Test classifier "tests" +"com.softwaremill.sttp.client3" %% "core" % "3.0.0-RC3" % Test classifier "tests" ``` Implement your backend and extend the `HttpTest` class: ```scala -import sttp.client._ -import sttp.client.testing.{ConvertToFuture, HttpTest} +import sttp.client3._ +import sttp.client3.testing.{ConvertToFuture, HttpTest} import scala.concurrent.Future class MyCustomBackendHttpTest extends HttpTest[Future] { @@ -308,7 +308,7 @@ You can find a more detailed example in the [sttp-vertx](https://github.com/guym When implementing a backend wrapper using cats, it might be useful to import: ```scala -import sttp.client.impl.cats.implicits._ +import sttp.client3.impl.cats.implicits._ ``` from the cats integration module. The module should be available on the classpath when using the cats [async-http-client](../catseffect.md) backend. The object contains implicits to convert a cats `MonadError` into the sttp `MonadError`, as well as a way to map the effects wrapper used with the `.mapK` extension method for the backend. diff --git a/generated-docs/out/backends/wrappers/logging.md b/generated-docs/out/backends/wrappers/logging.md index 05a4355d6a..639c74bd38 100644 --- a/generated-docs/out/backends/wrappers/logging.md +++ b/generated-docs/out/backends/wrappers/logging.md @@ -1,9 +1,9 @@ # Logging -The `sttp.client.logging.LoggingBackend` can log requests and responses which end successfully or with an exception. It can be created given: +The `sttp.client3.logging.LoggingBackend` can log requests and responses which end successfully or with an exception. It can be created given: -* a `sttp.client.logging.Logger`, which is an integration point with logging libraries. Two such integration that are available with sttp-client is slf4j and scribe (see below), but custom ones can be easily added. -* a `sttp.client.logging.Log`, which constructs messages and performs logging actions. A custom implementation can be provided to change default log levels or log message content. +* a `sttp.client3.logging.Logger`, which is an integration point with logging libraries. Two such integration that are available with sttp-client is slf4j and scribe (see below), but custom ones can be easily added. +* a `sttp.client3.logging.Log`, which constructs messages and performs logging actions. A custom implementation can be provided to change default log levels or log message content. By default, the following options are exposed: @@ -23,7 +23,7 @@ The messages are by default logged on these levels: To use the [slf4j](http://www.slf4j.org) logging backend wrapper, add the following dependency to your project: ``` -"com.softwaremill.sttp.client" %% "slf4j-backend" % "3.0.0-RC3" +"com.softwaremill.sttp.client3" %% "slf4j-backend" % "3.0.0-RC3" ``` There are three backend wrappers available, which log request & response information using a slf4j `Logger`. To see the logs, you'll need to use an slf4j-compatible logger implementation, e.g. [logback](http://logback.qos.ch), or use a binding, e.g. [log4j-slf4j](https://logging.apache.org/log4j/2.0/log4j-slf4j-impl/index.html). @@ -31,8 +31,8 @@ There are three backend wrappers available, which log request & response informa Example usage: ```scala -import sttp.client._ -import sttp.client.logging.slf4j.Slf4jLoggingBackend +import sttp.client3._ +import sttp.client3.logging.slf4j.Slf4jLoggingBackend val backend = Slf4jLoggingBackend(HttpURLConnectionBackend()) basicRequest.get(uri"https://httpbin.org/get").send(backend) @@ -45,5 +45,5 @@ To create a customised logging backend, see the section on [custom backends](cus To use the [scribe](https://github.com/outr/scribe) logging backend wrapper, add the following dependency to your project: ``` -"com.softwaremill.sttp.client" %% "scribe-backend" % "3.0.0-RC3" +"com.softwaremill.sttp.client3" %% "scribe-backend" % "3.0.0-RC3" ``` \ No newline at end of file diff --git a/generated-docs/out/backends/wrappers/opentracing.md b/generated-docs/out/backends/wrappers/opentracing.md index f5da84fe55..67ed4be5c8 100644 --- a/generated-docs/out/backends/wrappers/opentracing.md +++ b/generated-docs/out/backends/wrappers/opentracing.md @@ -3,7 +3,7 @@ To use, add the following dependency to your project: ``` -"com.softwaremill.sttp.client" %% "opentracing-backend" % "3.0.0-RC3" +"com.softwaremill.sttp.client3" %% "opentracing-backend" % "3.0.0-RC3" ``` This backend depends on [opentracing](https://github.com/opentracing/opentracing-java), a standardized set of api for distributed tracing. @@ -21,8 +21,8 @@ The backend obtains the current trace context using default spans's propagation There is an additional method exposed to override default operation id: ```scala -import sttp.client._ -import sttp.client.opentracing.OpenTracingBackend._ +import sttp.client3._ +import sttp.client3.opentracing.OpenTracingBackend._ basicRequest .get(???) @@ -32,8 +32,8 @@ basicRequest There is an additional method exposed to customize generated span: ```scala -import sttp.client._ -import sttp.client.opentracing.OpenTracingBackend._ +import sttp.client3._ +import sttp.client3.opentracing.OpenTracingBackend._ basicRequest .get(???) diff --git a/generated-docs/out/backends/wrappers/prometheus.md b/generated-docs/out/backends/wrappers/prometheus.md index f95e9b7f94..33824255be 100644 --- a/generated-docs/out/backends/wrappers/prometheus.md +++ b/generated-docs/out/backends/wrappers/prometheus.md @@ -3,13 +3,13 @@ To use, add the following dependency to your project: ``` -"com.softwaremill.sttp.client" %% "prometheus-backend" % "3.0.0-RC3" +"com.softwaremill.sttp.client3" %% "prometheus-backend" % "3.0.0-RC3" ``` and some imports: ```scala -import sttp.client.prometheus._ +import sttp.client3.prometheus._ ``` This backend depends on [Prometheus JVM Client](https://github.com/prometheus/client_java). Keep in mind this backend registers histograms and gathers request times, but you have to expose those metrics to [Prometheus](https://prometheus.io/) e.g. using [prometheus-akka-http](https://github.com/lonelyplanet/prometheus-akka-http). @@ -17,34 +17,34 @@ This backend depends on [Prometheus JVM Client](https://github.com/prometheus/cl The Prometheus backend wraps any other backend, for example: ```scala -import sttp.client.akkahttp._ +import sttp.client3.akkahttp._ val backend = PrometheusBackend(AkkaHttpBackend()) ``` It gathers request execution times in `Histogram`. It uses by default `sttp_request_latency` name, defined in `PrometheusBackend.DefaultHistogramName`. It is possible to define custom histograms name by passing function mapping request to histogram name: ```scala -import sttp.client.akkahttp._ +import sttp.client3.akkahttp._ val backend = PrometheusBackend(AkkaHttpBackend(), requestToHistogramNameMapper = request => Some(HistogramCollectorConfig(request.uri.host))) ``` You can disable request histograms by passing `None` returning function: ```scala -import sttp.client.akkahttp._ +import sttp.client3.akkahttp._ val backend = PrometheusBackend(AkkaHttpBackend(), requestToHistogramNameMapper = _ => None) ``` This backend also offers `Gauge` with currently in-progress requests number. It uses by default `sttp_requests_in_progress` name, defined in `PrometheusBackend.DefaultRequestsInProgressGaugeName`. It is possible to define custom gauge name by passing function mapping request to gauge name: ```scala -import sttp.client.akkahttp._ +import sttp.client3.akkahttp._ val backend = PrometheusBackend(AkkaHttpBackend(), requestToInProgressGaugeNameMapper = request => Some(CollectorConfig(request.uri.host))) ``` You can disable request in-progress gauges by passing `None` returning function: ```scala -import sttp.client.akkahttp._ +import sttp.client3.akkahttp._ val backend = PrometheusBackend(AkkaHttpBackend(), requestToInProgressGaugeNameMapper = _ => None) ``` diff --git a/generated-docs/out/backends/wrappers/slf4j.md b/generated-docs/out/backends/wrappers/slf4j.md index 8cd11fb807..7d24b67dab 100644 --- a/generated-docs/out/backends/wrappers/slf4j.md +++ b/generated-docs/out/backends/wrappers/slf4j.md @@ -5,14 +5,14 @@ There are three backend wrappers available, which log request & response informa To use the backend wrappers, add the following dependency to your project: ``` -"com.softwaremill.sttp.client" %% "slf4j-backend" % "3.0.0-RC1" +"com.softwaremill.sttp.client3" %% "slf4j-backend" % "3.0.0-RC1" ``` The following backend wrappers are available: ```scala -import sttp.client._ -import sttp.client.logging.slf4j._ +import sttp.client3._ +import sttp.client3.logging.slf4j._ val delegateBackend: SttpBackend[Identity, Any] = ??? Slf4jLoggingBackend(delegateBackend) @@ -29,8 +29,8 @@ The curl backend logs `DEBUG`-level logs when a request completes successfully o Example usage: ```scala -import sttp.client._ -import sttp.client.logging.slf4j.Slf4jTimingBackend +import sttp.client3._ +import sttp.client3.logging.slf4j.Slf4jTimingBackend val backend = Slf4jTimingBackend(HttpURLConnectionBackend()) basicRequest.get(uri"https://httpbin.org/get").send(backend) diff --git a/generated-docs/out/backends/wrappers/zio-opentracing.md b/generated-docs/out/backends/wrappers/zio-opentracing.md index 1ecaa12752..8131a530df 100644 --- a/generated-docs/out/backends/wrappers/zio-opentracing.md +++ b/generated-docs/out/backends/wrappers/zio-opentracing.md @@ -3,7 +3,7 @@ To use, add the following dependency to your project: ``` -"com.softwaremill.sttp.client" %% "zio-telemetry-opentracing-backend" % "3.0.0-RC3" +"com.softwaremill.sttp.client3" %% "zio-telemetry-opentracing-backend" % "3.0.0-RC3" ``` This backend depends on [zio-opentracing](https://github.com/zio/zio-telemetry). @@ -19,10 +19,10 @@ new ZioTelemetryOpenTracingBackend(zioBackend) Additionally you can add tags per request by supplying a `ZioTelemetryOpenTracingTracer` ```scala -import sttp.client._ +import sttp.client3._ import zio._ import zio.telemetry.opentracing._ -import sttp.client.ziotelemetry.opentracing._ +import sttp.client3.ziotelemetry.opentracing._ implicit val zioBackend: SttpBackend[Task, Any] = ??? diff --git a/generated-docs/out/backends/zio.md b/generated-docs/out/backends/zio.md index 6e7f27779d..05b08597cf 100644 --- a/generated-docs/out/backends/zio.md +++ b/generated-docs/out/backends/zio.md @@ -7,7 +7,7 @@ The [ZIO](https://github.com/zio/zio) backends are **asynchronous**. Sending a r To use, add the following dependency to your project: ```scala -"com.softwaremill.sttp.client" %% "async-http-client-backend-zio" % "3.0.0-RC3" +"com.softwaremill.sttp.client3" %% "async-http-client-backend-zio" % "3.0.0-RC3" ``` This backend depends on [async-http-client](https://github.com/AsyncHttpClient/async-http-client), uses [Netty](http://netty.io) behind the scenes and supports effect cancellation. This backend works with all Scala versions. A Dotty build is available as well. @@ -20,8 +20,8 @@ Next you'll need to define a backend instance as an implicit value. This can be A non-comprehensive summary of how the backend can be created is as follows: ```scala -import sttp.client._ -import sttp.client.asynchttpclient.zio.AsyncHttpClientZioBackend +import sttp.client3._ +import sttp.client3.asynchttpclient.zio.AsyncHttpClientZioBackend AsyncHttpClientZioBackend().flatMap { backend => ??? } @@ -53,13 +53,13 @@ val backend = AsyncHttpClientZioBackend.usingClient(runtime, asyncHttpClient) To use, add the following dependency to your project: ``` -"com.softwaremill.sttp.client" %% "httpclient-backend-zio" % "3.0.0-RC3" +"com.softwaremill.sttp.client3" %% "httpclient-backend-zio" % "3.0.0-RC3" ``` Create the backend using: ```scala -import sttp.client.httpclient.zio.HttpClientZioBackend +import sttp.client3.httpclient.zio.HttpClientZioBackend HttpClientZioBackend().flatMap { backend => ??? } @@ -79,12 +79,12 @@ This backend is based on the built-in `java.net.http.HttpClient` available from As an alternative to effectfully or resourcefully creating backend instances, ZIO environment can be used. In this case, a type alias is provided for the service definition: ```scala -package sttp.client.asynchttpclient.zio +package sttp.client3.asynchttpclient.zio type SttpClient = Has[SttpBackend[Task, ZioStreams with WebSockets]] // or, when using Java 11 & HttpClient -package sttp.client.httpclient.zio +package sttp.client3.httpclient.zio type SttpClient = Has[SttpBackend[BlockingTask, BlockingZioStreams with WebSockets]] ``` @@ -93,8 +93,8 @@ The lifecycle of the `SttpClient` service is described by `ZLayer`s, which can b The `SttpClient` companion object contains effect descriptions which use the `SttpClient` service from the environment to send requests or open websockets. This is different from sttp usage with other effect libraries (which use an implicit backend when `.send(backend)` is invoked on the request), but is more in line with how other ZIO services work. For example: ```scala -import sttp.client._ -import sttp.client.asynchttpclient.zio._ +import sttp.client3._ +import sttp.client3.asynchttpclient.zio._ import zio._ val request = basicRequest.get(uri"https://httpbin.org/get") @@ -106,14 +106,14 @@ val sent: ZIO[SttpClient, Throwable, Response[Either[String, String]]] = The ZIO based backends support streaming using zio-streams. The following example is using the `AsyncHttpClientZioBackend` backend, but works similarly with `HttpClientZioBackend`. -The type of supported streams is `Stream[Throwable, Byte]`. The streams capability is represented as `sttp.client.impl.zio.ZioStreams`. To leverage ZIO environment, use the `SttpClient` object to create request send effects. +The type of supported streams is `Stream[Throwable, Byte]`. The streams capability is represented as `sttp.client3.impl.zio.ZioStreams`. To leverage ZIO environment, use the `SttpClient` object to create request send effects. Requests can be sent with a streaming body: ```scala import sttp.capabilities.zio.ZioStreams -import sttp.client._ -import sttp.client.asynchttpclient.zio.send +import sttp.client3._ +import sttp.client3.asynchttpclient.zio.send import zio.stream._ val s: Stream[Throwable, Byte] = ??? @@ -129,8 +129,8 @@ And receive response bodies as a stream: ```scala import sttp.capabilities.zio.ZioStreams -import sttp.client._ -import sttp.client.asynchttpclient.zio.{SttpClient, send} +import sttp.client3._ +import sttp.client3.asynchttpclient.zio.{SttpClient, send} import zio._ import zio.stream._ @@ -156,11 +156,11 @@ The ZIO backends also support a ZIO-familiar way of configuring [stubs](../testi usual way of creating a stand-alone stub, you can also define your stubs as effects instead: ```scala -import sttp.client._ +import sttp.client3._ import sttp.model._ -import sttp.client.asynchttpclient._ -import sttp.client.asynchttpclient.zio._ -import sttp.client.asynchttpclient.zio.stubbing._ +import sttp.client3.asynchttpclient._ +import sttp.client3.asynchttpclient.zio._ +import sttp.client3.asynchttpclient.zio.stubbing._ val stubEffect = for { _ <- whenRequestMatches(_.uri.toString.endsWith("c")).thenRespond("c") diff --git a/generated-docs/out/conf/proxy.md b/generated-docs/out/conf/proxy.md index aa2677c8f9..017fd2fd6c 100644 --- a/generated-docs/out/conf/proxy.md +++ b/generated-docs/out/conf/proxy.md @@ -13,7 +13,7 @@ Settings are loaded **in given order** and the **first existing value** is being Otherwise, proxy values can be specified manually when creating a backend: ```scala -import sttp.client._ +import sttp.client3._ val backend = HttpURLConnectionBackend( options = SttpBackendOptions.httpProxy("some.host", 8080)) @@ -26,7 +26,7 @@ basicRequest Or in case your proxy requires authentication (supported by the JVM backends): ```scala -import sttp.client._ +import sttp.client3._ SttpBackendOptions.httpProxy("some.host", 8080, "username", "password") ``` diff --git a/generated-docs/out/conf/redirects.md b/generated-docs/out/conf/redirects.md index 04600d953f..1ad11d3dbc 100644 --- a/generated-docs/out/conf/redirects.md +++ b/generated-docs/out/conf/redirects.md @@ -5,7 +5,7 @@ By default, sttp follows redirects. If you'd like to disable following redirects, use the `followRedirects` method: ```scala -import sttp.client._ +import sttp.client3._ basicRequest.followRedirects(false) ``` @@ -19,7 +19,7 @@ If a `POST` or `PUT` request is redirected, by default it will be sent unchanged To enable this behavior, use the `redirectToGet` method: ```scala -import sttp.client._ +import sttp.client3._ basicRequest.redirectToGet(true) ``` diff --git a/generated-docs/out/conf/timeouts.md b/generated-docs/out/conf/timeouts.md index 7181b443a4..f12cd22605 100644 --- a/generated-docs/out/conf/timeouts.md +++ b/generated-docs/out/conf/timeouts.md @@ -8,7 +8,7 @@ sttp supports read and connection timeouts: How to use: ```scala -import sttp.client._ +import sttp.client3._ import scala.concurrent.duration._ // all backends provide a constructor that allows to specify backend options diff --git a/generated-docs/out/examples.md b/generated-docs/out/examples.md index 44ef1bd9f2..1d2d3f531f 100644 --- a/generated-docs/out/examples.md +++ b/generated-docs/out/examples.md @@ -7,7 +7,7 @@ All of the examples are available [in the sources](https://github.com/softwaremi Required dependencies: ```scala -libraryDependencies ++= List("com.softwaremill.sttp.client" %% "core" % "3.0.0-RC3") +libraryDependencies ++= List("com.softwaremill.sttp.client3" %% "core" % "3.0.0-RC3") ``` Example code: @@ -23,8 +23,8 @@ Required dependencies: ```scala libraryDependencies ++= List( - "com.softwaremill.sttp.client" %% "akka-http-backend" % "3.0.0-RC3", - "com.softwaremill.sttp.client" %% "json4s" % "3.0.0-RC3", + "com.softwaremill.sttp.client3" %% "akka-http-backend" % "3.0.0-RC3", + "com.softwaremill.sttp.client3" %% "json4s" % "3.0.0-RC3", "org.json4s" %% "json4s-native" % "3.6.0" ) ``` @@ -42,8 +42,8 @@ Required dependencies: ```scala libraryDependencies ++= List( - "com.softwaremill.sttp.client" %% "async-http-client-backend-zio" % "3.0.0-RC3", - "com.softwaremill.sttp.client" %% "circe" % "3.0.0-RC3", + "com.softwaremill.sttp.client3" %% "async-http-client-backend-zio" % "3.0.0-RC3", + "com.softwaremill.sttp.client3" %% "circe" % "3.0.0-RC3", "io.circe" %% "circe-generic" % "0.13.0" ) ``` @@ -61,8 +61,8 @@ Required dependencies: ```scala libraryDependencies ++= List( - "com.softwaremill.sttp.client" %% "async-http-client-backend-monix" % "3.0.0-RC3", - "com.softwaremill.sttp.client" %% "circe" % "3.0.0-RC3", + "com.softwaremill.sttp.client3" %% "async-http-client-backend-monix" % "3.0.0-RC3", + "com.softwaremill.sttp.client3" %% "circe" % "3.0.0-RC3", "io.circe" %% "circe-generic" % "0.13.0" ) ``` @@ -80,8 +80,8 @@ Required dependencies: ```scala libraryDependencies ++= List( - "com.softwaremill.sttp.client" %% "slf4j-backend" % "3.0.0-RC3", - "com.softwaremill.sttp.client" %% "circe" % "3.0.0-RC3", + "com.softwaremill.sttp.client3" %% "slf4j-backend" % "3.0.0-RC3", + "com.softwaremill.sttp.client3" %% "circe" % "3.0.0-RC3", "io.circe" %% "circe-generic" % "0.13.0" ) ``` @@ -99,8 +99,8 @@ Required dependencies: ```scala libraryDependencies ++= List( - "com.softwaremill.sttp.client" %% "async-http-client-backend-monix" % "3.0.0-RC3", - "com.softwaremill.sttp.client" %% "circe" % "3.0.0-RC3", + "com.softwaremill.sttp.client3" %% "async-http-client-backend-monix" % "3.0.0-RC3", + "com.softwaremill.sttp.client3" %% "circe" % "3.0.0-RC3", "io.circe" %% "circe-generic" % "0.13.0" ) ``` @@ -117,7 +117,7 @@ Example code: Required dependencies: ```scala -libraryDependencies ++= List("com.softwaremill.sttp.client" %% "core" % "3.0.0-RC3") +libraryDependencies ++= List("com.softwaremill.sttp.client3" %% "core" % "3.0.0-RC3") ``` Example code: @@ -132,7 +132,7 @@ Example code: Required dependencies: ```scala -libraryDependencies ++= List("com.softwaremill.sttp.client" %% "async-http-client-backend-zio" % "3.0.0-RC3") +libraryDependencies ++= List("com.softwaremill.sttp.client3" %% "async-http-client-backend-zio" % "3.0.0-RC3") ``` Example code: @@ -147,7 +147,7 @@ Example code: Required dependencies: ```scala -libraryDependencies ++= List("com.softwaremill.sttp.client" %% "async-http-client-backend-fs2 % "3.0.0-RC3") +libraryDependencies ++= List("com.softwaremill.sttp.client3" %% "async-http-client-backend-fs2 % "3.0.0-RC3") ``` Example code: @@ -162,7 +162,7 @@ Example code: Required dependencies: ```scala -libraryDependencies ++= List("com.softwaremill.sttp.client" %% "async-http-client-backend-monix % "3.0.0-RC3") +libraryDependencies ++= List("com.softwaremill.sttp.client3" %% "async-http-client-backend-monix % "3.0.0-RC3") ``` Example code: @@ -177,7 +177,7 @@ Example code: Required dependencies: ```scala -libraryDependencies ++= List("com.softwaremill.sttp.client" %% "akka-http-backend" % "3.0.0-RC3") +libraryDependencies ++= List("com.softwaremill.sttp.client3" %% "akka-http-backend" % "3.0.0-RC3") ``` Example code: @@ -192,7 +192,7 @@ Example code: Required dependencies: ```scala -libraryDependencies ++= List("com.softwaremill.sttp.client" %% "async-http-client-backend-monix" % "3.0.0-RC3") +libraryDependencies ++= List("com.softwaremill.sttp.client3" %% "async-http-client-backend-monix" % "3.0.0-RC3") ``` Example code: @@ -207,7 +207,7 @@ Example code: Required dependencies: ```scala -libraryDependencies ++= List("com.softwaremill.sttp.client" %% "async-http-client-backend-fs2" % "3.0.0-RC3") +libraryDependencies ++= List("com.softwaremill.sttp.client3" %% "async-http-client-backend-fs2" % "3.0.0-RC3") ``` Example code: @@ -222,7 +222,7 @@ Example code: Required dependencies: ```scala -libraryDependencies ++= List("com.softwaremill.sttp.client" %% "async-http-client-backend-zio" % "3.0.0-RC3") +libraryDependencies ++= List("com.softwaremill.sttp.client3" %% "async-http-client-backend-zio" % "3.0.0-RC3") ``` Example code: @@ -237,7 +237,7 @@ Example code: Required dependencies: ```scala -libraryDependencies ++= List("com.softwaremill.sttp.client" %% "async-http-client-backend-zio" % "3.0.0-RC3") +libraryDependencies ++= List("com.softwaremill.sttp.client3" %% "async-http-client-backend-zio" % "3.0.0-RC3") ``` Example code: @@ -252,7 +252,7 @@ Example code: Required dependencies: ```scala -libraryDependencies ++= List("com.softwaremill.sttp.client" %% "core" % "3.0.0-RC3") +libraryDependencies ++= List("com.softwaremill.sttp.client3" %% "core" % "3.0.0-RC3") ``` Example code: diff --git a/generated-docs/out/how.md b/generated-docs/out/how.md index b625421d57..f2cf9350a5 100644 --- a/generated-docs/out/how.md +++ b/generated-docs/out/how.md @@ -4,18 +4,18 @@ This first step when using sttp client is describing the request that you'd like to send. -A request is represented as an immutable data structure of type `RequestT` (as in Request Template). The basic request is provided as the `basicRequest` value, in the `sttp.client` package. It can be refined using one of the available methods, such as `.header`, `.body`, `.get(Uri)`, `.responseAs`, etc. +A request is represented as an immutable data structure of type `RequestT` (as in Request Template). The basic request is provided as the `basicRequest` value, in the `sttp.client3` package. It can be refined using one of the available methods, such as `.header`, `.body`, `.get(Uri)`, `.responseAs`, etc. A `RequestT` value contains both information on what to include in the request, but also how to handle the response body. To start describing a request, import the sttp client package and customise `basicRequest`: ```scala -import sttp.client._ +import sttp.client3._ val myRequest: Request[_, _] = ??? // basicRequest.(...) ``` -An alternative to importing the `sttp.client._` package, is to extend the `sttp.client.SttpApi` trait. That way, multiple integrations can be grouped in one object, thus reducing the number of necessary imports. +An alternative to importing the `sttp.client3._` package, is to extend the `sttp.client3.SttpApi` trait. That way, multiple integrations can be grouped in one object, thus reducing the number of necessary imports. ## Send the request @@ -30,7 +30,7 @@ Backends manage the connection pool, thread pools for handling responses, depend For example, the following sends a synchronous request, using the default JVM backend: ```scala -import sttp.client._ +import sttp.client3._ val myRequest: Request[String, Any] = ??? val backend = HttpURLConnectionBackend() val response = myRequest.send(backend) diff --git a/generated-docs/out/index.md b/generated-docs/out/index.md index 4482fad8b4..f100cd2aae 100644 --- a/generated-docs/out/index.md +++ b/generated-docs/out/index.md @@ -10,7 +10,7 @@ Backend implementations include ones based on [akka-http](https://doc.akka.io/do Here's a very quick example of sttp client in action: ```scala -import sttp.client._ +import sttp.client3._ val query = "http language:scala" val sort: Option[String] = None diff --git a/generated-docs/out/json.md b/generated-docs/out/json.md index dec8a972d4..0dd8c26d60 100644 --- a/generated-docs/out/json.md +++ b/generated-docs/out/json.md @@ -2,7 +2,7 @@ Adding support for JSON (or other format) bodies in requests/responses is a matter of providing a [body serializer](requests/body.md) and/or a [response body specification](responses/body.md). Both are quite straightforward to implement, so integrating with your favorite JSON library shouldn't be a problem. However, there are some integrations available out-of-the-box. -Each integration is available as an import, which brings the implicit `BodySerializer`s and `asJson` methods into scope. Alternatively, these values are grouped intro traits (e.g. `sttp.client.circe.SttpCirceApi`), which can be extended to group multiple integrations in one object, and thus reduce the number of necessary imports. +Each integration is available as an import, which brings the implicit `BodySerializer`s and `asJson` methods into scope. Alternatively, these values are grouped intro traits (e.g. `sttp.client3.circe.SttpCirceApi`), which can be extended to group multiple integrations in one object, and thus reduce the number of necessary imports. The following variants of `asJson` methods are available: @@ -13,7 +13,7 @@ The following variants of `asJson` methods are available: The type signatures vary depending on the underlying library (required implicits and error representation differs), but they obey the following pattern: ```scala -import sttp.client._ +import sttp.client3._ def asJson[B]: ResponseAs[Either[ResponseException[String, Exception], B], Any] = ??? def asJsonAlways[B]: ResponseAs[Either[DeserializationException[Exception], B], Any] = ??? @@ -34,7 +34,7 @@ case class ResponsePayload(data: String) JSON encoding of bodies and decoding of responses can be handled using [Circe](https://circe.github.io/circe/) by the `circe` module. To use add the following dependency to your project: ```scala -"com.softwaremill.sttp.client" %% "circe" % "3.0.0-RC3" +"com.softwaremill.sttp.client3" %% "circe" % "3.0.0-RC3" ``` This module adds a body serialized, so that json payloads can be sent as request bodies. To send a payload of type `T` as json, a `io.circe.Encoder[T]` implicit value must be available in scope. @@ -43,8 +43,8 @@ Automatic and semi-automatic derivation of encoders is possible by using the [ci Response can be parsed into json using `asJson[T]`, provided there's an implicit `io.circe.Decoder[T]` in scope. The decoding result will be represented as either a http/deserialization error, or the parsed value. For example: ```scala -import sttp.client._ -import sttp.client.circe._ +import sttp.client3._ +import sttp.client3.circe._ val backend: SttpBackend[Identity, Any] = HttpURLConnectionBackend() @@ -66,7 +66,7 @@ Arbitrary JSON structures can be traversed by parsing the result as `io.circe.Js To encode and decode json using json4s, add the following dependency to your project: ``` -"com.softwaremill.sttp.client" %% "json4s" % "3.0.0-RC3" +"com.softwaremill.sttp.client3" %% "json4s" % "3.0.0-RC3" "org.json4s" %% "json4s-native" % "3.6.0" ``` @@ -77,8 +77,8 @@ Using this module it is possible to set request bodies and read response bodies Usage example: ```scala -import sttp.client._ -import sttp.client.json4s._ +import sttp.client3._ +import sttp.client3.json4s._ val backend: SttpBackend[Identity, Any] = HttpURLConnectionBackend() @@ -100,7 +100,7 @@ val response: Identity[Response[Either[ResponseException[String, Exception], Res To encode and decode JSON using [spray-json](https://github.com/spray/spray-json), add the following dependency to your project: ``` -"com.softwaremill.sttp.client" %% "spray-json" % "3.0.0-RC3" +"com.softwaremill.sttp.client3" %% "spray-json" % "3.0.0-RC3" ``` Using this module it is possible to set request bodies and read response bodies as your custom types, using the implicitly available instances of `spray.json.JsonWriter` / `spray.json.JsonReader` or `spray.json.JsonFormat`. @@ -108,8 +108,8 @@ Using this module it is possible to set request bodies and read response bodies Usage example: ```scala -import sttp.client._ -import sttp.client.sprayJson._ +import sttp.client3._ +import sttp.client3.sprayJson._ import spray.json._ val backend: SttpBackend[Identity, Any] = HttpURLConnectionBackend() @@ -132,7 +132,7 @@ val response: Identity[Response[Either[ResponseException[String, Exception], Res To encode and decode JSON using [play-json](https://www.playframework.com), add the following dependency to your project: ```scala -"com.softwaremill.sttp.client" %% "play-json" % "3.0.0-RC3" +"com.softwaremill.sttp.client3" %% "play-json" % "3.0.0-RC3" ``` -To use, add an import: `import sttp.client.playJson._`. +To use, add an import: `import sttp.client3.playJson._`. diff --git a/generated-docs/out/model/model.md b/generated-docs/out/model/model.md index f08451d943..29948a804b 100644 --- a/generated-docs/out/model/model.md +++ b/generated-docs/out/model/model.md @@ -20,7 +20,7 @@ The model also contains aggregate/helper classes such as `Headers` and `MultiQue Example with objects: ```scala -import sttp.client._ +import sttp.client3._ import sttp.model._ object Example { @@ -36,7 +36,7 @@ object Example { Example with traits: ```scala -import sttp.client._ +import sttp.client3._ import sttp.model._ object Example extends HeaderNames with MediaTypes with StatusCodes { diff --git a/generated-docs/out/model/uri.md b/generated-docs/out/model/uri.md index 4c369b8e68..e28be83e59 100644 --- a/generated-docs/out/model/uri.md +++ b/generated-docs/out/model/uri.md @@ -11,7 +11,7 @@ The `Uri` class is immutable, and can be constructed by hand, but in many cases Using the URI interpolator it's possible to conveniently create `Uri` instances, for example: ```scala -import sttp.client._ +import sttp.client3._ import sttp.model._ val user = "Mary Smith" @@ -30,7 +30,7 @@ Any values embedded in the URI will be URL-encoded, taking into account the cont All components of the URI can be embedded from values: scheme, username/password, host, port, path, query and fragment. The embedded values won't be further parsed, with the exception of the `:` in the host part, which is commonly used to pass in both the host and port: ```scala -import sttp.client._ +import sttp.client3._ // the embedded / is escaped println(uri"http://example.org/${"a/b"}") @@ -104,7 +104,7 @@ This is useful when a base URI is stored in a value, and can then be used as a b A fully-featured example: ```scala -import sttp.client._ +import sttp.client3._ val secure = true val scheme = if (secure) "https" else "http" val subdomains = List("sub1", "sub2") diff --git a/generated-docs/out/openapi.md b/generated-docs/out/openapi.md index 76cb49db88..68cc391a40 100644 --- a/generated-docs/out/openapi.md +++ b/generated-docs/out/openapi.md @@ -36,8 +36,8 @@ lazy val petstoreApi: Project = project openApiGeneratorName := "scala-sttp", openApiOutputDir := baseDirectory.value.name, libraryDependencies ++= Seq( - "com.softwaremill.sttp.client" %% "core" % "3.0.0-RC3", - "com.softwaremill.sttp.client" %% "json4s" % "3.0.0-RC3", + "com.softwaremill.sttp.client3" %% "core" % "3.0.0-RC3", + "com.softwaremill.sttp.client3" %% "json4s" % "3.0.0-RC3", "org.json4s" %% "json4s-jackson" % "3.6.8" ) ) @@ -87,8 +87,8 @@ lazy val petstoreApi: Project = project openApiOutputDir := baseDirectory.value.name, openApiIgnoreFileOverride := s"${baseDirectory.in(ThisBuild).value.getPath}/openapi-ignore-file", libraryDependencies ++= Seq( - "com.softwaremill.sttp.client" %% "core" % "3.0.0-RC3", - "com.softwaremill.sttp.client" %% "json4s" % "3.0.0-RC3", + "com.softwaremill.sttp.client3" %% "core" % "3.0.0-RC3", + "com.softwaremill.sttp.client3" %% "json4s" % "3.0.0-RC3", "org.json4s" %% "json4s-jackson" % "3.6.8" ), (compile in Compile) := ((compile in Compile) dependsOn openApiGenerate).value, diff --git a/generated-docs/out/quickstart.md b/generated-docs/out/quickstart.md index 7cbe99fc00..03c0c7be46 100644 --- a/generated-docs/out/quickstart.md +++ b/generated-docs/out/quickstart.md @@ -9,7 +9,7 @@ To integrate with other parts of your application, you'll often need to use an a The basic dependency which provides the API and the default synchronous backend is: ```scala -"com.softwaremill.sttp.client" %% "core" % "3.0.0-RC3" +"com.softwaremill.sttp.client3" %% "core" % "3.0.0-RC3" ``` `sttp client` is available for Scala 2.11, 2.12 and 2.13, and requires Java 8, as well as for Dotty (Scala 3) 0.23. @@ -21,27 +21,27 @@ The basic dependency which provides the API and the default synchronous backend If you are an [Ammonite](https://ammonite.io) user, you can quickly start experimenting with sttp by copy-pasting the following: ```scala -import $ivy.`com.softwaremill.sttp.client::core:3.0.0-RC3` -import sttp.client.quick._ +import $ivy.`com.softwaremill.sttp.client3::core:3.0.0-RC3` +import sttp.client3.quick._ quickRequest.get(uri"http://httpbin.org/ip").send(backend) ``` -Importing the `quick` object has the same effect as importing `sttp.client._`, plus defining an implicit synchronous backend (`implict val backend = HttpURLConnectionBackend()`), so that sttp can be used right away. +Importing the `quick` object has the same effect as importing `sttp.client3._`, plus defining an implicit synchronous backend (`implict val backend = HttpURLConnectionBackend()`), so that sttp can be used right away. If the default `HttpURLConnectionBackend` for some reason is insufficient, you can also use one based on OkHttp: ```scala -import $ivy.`com.softwaremill.sttp.client::okhttp-backend:3.0.0-RC3` -import sttp.client.okhttp.quick._ +import $ivy.`com.softwaremill.sttp.client3::okhttp-backend:3.0.0-RC3` +import sttp.client3.okhttp.quick._ quickRequest.get(uri"http://httpbin.org/ip").send(backend) ``` ## Imports -Working with sttp is most convenient if you import the `sttp.client` package entirely: +Working with sttp is most convenient if you import the `sttp.client3` package entirely: ```scala -import sttp.client._ +import sttp.client3._ ``` This brings into scope the starting point for defining requests and some helper methods. All examples in this guide assume that this import is in place. @@ -49,7 +49,7 @@ This brings into scope the starting point for defining requests and some helper And that's all you need to start using sttp client! To create and send your first request, import the above, type `basicRequest.` and see where your IDE's auto-complete gets you! Here's a simple request, using the synchronous backend: ```scala -import sttp.client._ +import sttp.client3._ val backend = HttpURLConnectionBackend() val response = basicRequest diff --git a/generated-docs/out/requests/authentication.md b/generated-docs/out/requests/authentication.md index 6a32aff413..4e6e9404bc 100644 --- a/generated-docs/out/requests/authentication.md +++ b/generated-docs/out/requests/authentication.md @@ -5,7 +5,7 @@ sttp supports basic, bearer-token based authentication and digest authentication Basic authentication, using which the username and password are encoded using Base64, can be added as follows: ```scala -import sttp.client._ +import sttp.client3._ val username = "mary" val password = "p@assword" @@ -60,7 +60,7 @@ You can use sttp with OAuth2. Looking at the [OAuth2 protocol flow](https://tool 2. (C)/(D) - You need to send a request to the authentication server, passing in the authentication code from step 1. You'll receive an access token in response (and optionally a refresh token). For example, if you were using GitHub as your authentication server, you'd need to take the values of `clientId` and `clientSecret` from the GitHub settings, then take the `authCode` received in step 1 above, and send a request like this: ```scala -import sttp.client.circe._ +import sttp.client3.circe._ import io.circe._ import io.circe.generic.semiauto._ diff --git a/generated-docs/out/requests/basics.md b/generated-docs/out/requests/basics.md index 40b6b6d481..45bf8d5c2c 100644 --- a/generated-docs/out/requests/basics.md +++ b/generated-docs/out/requests/basics.md @@ -3,7 +3,7 @@ As mentioned in the [quickstart](../quickstart.md), the following import will be needed: ```scala -import sttp.client._ +import sttp.client3._ ``` This brings into scope `basicRequest`, the starting request. This request can be customised, each time yielding a new, immutable request definition (unless a mutable body is set on the request, such as a byte array). As the request definition is immutable, it can be freely stored in values, shared across threads, and customized multiple times in various ways. diff --git a/generated-docs/out/requests/body.md b/generated-docs/out/requests/body.md index db7ac87fbc..adcd3e666c 100644 --- a/generated-docs/out/requests/body.md +++ b/generated-docs/out/requests/body.md @@ -11,14 +11,14 @@ In its simplest form, the request's body can be set as a `String`. By default, t A `String` body can be set on a request as follows: ```scala -import sttp.client._ +import sttp.client3._ basicRequest.body("Hello, world!") ``` It is also possible to use a different character encoding: ```scala -import sttp.client._ +import sttp.client3._ basicRequest.body("Hello, world!", "utf-8") ``` @@ -27,7 +27,7 @@ basicRequest.body("Hello, world!", "utf-8") To set a binary-data body, the following methods are available: ```scala -import sttp.client._ +import sttp.client3._ val bytes: Array[Byte] = ??? basicRequest.body(bytes) @@ -54,7 +54,7 @@ If not specified before, these methods will set the content type to `application To upload a file, simply set the request body as a `File` or `Path`: ```scala -import sttp.client._ +import sttp.client3._ import java.io.File basicRequest.body(new File("data.txt")) @@ -76,7 +76,7 @@ If you set the body as a `Map[String, String]` or `Seq[(String, String)]`, it wi By default, the `UTF-8` encoding is used, but can be also specified explicitly: ```scala -import sttp.client._ +import sttp.client3._ basicRequest.body(Map("k1" -> "v1")) basicRequest.body(Map("k1" -> "v1"), "utf-8") basicRequest.body("k1" -> "v1", "k2" -> "v2") @@ -96,7 +96,7 @@ A `BasicRequestBody` is a wrapper for one of the supported request body types: a For example, here's how to write a custom serializer for a case class, with serializer-specific default content type: ```scala -import sttp.client._ +import sttp.client3._ import sttp.model.MediaType case class Person(name: String, surname: String, age: Int) diff --git a/generated-docs/out/requests/cookies.md b/generated-docs/out/requests/cookies.md index f718357f1c..702ed96d2c 100644 --- a/generated-docs/out/requests/cookies.md +++ b/generated-docs/out/requests/cookies.md @@ -7,7 +7,7 @@ Cookies are currently only available on the JVM. Cookies can also be set using the following methods: ```scala -import sttp.client._ +import sttp.client3._ import sttp.model._ basicRequest @@ -22,7 +22,7 @@ basicRequest It is often necessary to copy cookies from a response, e.g. after a login request is sent, and a successful response with the authentication cookie received. Having an object `response: Response[_]`, cookies on a request can be copied: ```scala -import sttp.client._ +import sttp.client3._ val backend = HttpURLConnectionBackend() val loginRequest = basicRequest @@ -37,7 +37,7 @@ basicRequest.cookies(response) Or, it's also possible to store only the `sttp.model.CookieWithMeta` objects (a sequence of which can be obtained from a response), and set the on the request: ```scala -import sttp.client._ +import sttp.client3._ val backend = HttpURLConnectionBackend() val loginRequest = basicRequest diff --git a/generated-docs/out/requests/headers.md b/generated-docs/out/requests/headers.md index b62fff89a3..eee5258f73 100644 --- a/generated-docs/out/requests/headers.md +++ b/generated-docs/out/requests/headers.md @@ -3,7 +3,7 @@ Arbitrary headers can be set on the request using the `.header` method: ```scala -import sttp.client._ +import sttp.client3._ basicRequest.header("User-Agent", "myapp") ``` @@ -15,7 +15,7 @@ While most headers should be set only once on a request, HTTP allows setting a h There are also variants of this method accepting a number of headers: ```scala -import sttp.client._ +import sttp.client3._ import sttp.model._ basicRequest.header(Header("k1", "v1"), replaceExisting = false) @@ -30,7 +30,7 @@ basicRequest.headers(Header("k9", "v9"), Header("k10", "v10"), Header("k11", "v1 For some common headers, dedicated methods are provided: ```scala -import sttp.client._ +import sttp.client3._ basicRequest.contentType("application/json") basicRequest.contentType("application/json", "iso-8859-1") diff --git a/generated-docs/out/requests/multipart.md b/generated-docs/out/requests/multipart.md index 5d87fb34e6..cb881a3267 100644 --- a/generated-docs/out/requests/multipart.md +++ b/generated-docs/out/requests/multipart.md @@ -1,6 +1,6 @@ # Multipart requests -To set a multipart body on a request, the `multipartBody` method should be used (instead of `body`). Each body part is represented as an instance of `Part[BasicRequestBody]`, which can be conveniently constructed using `multipart` methods coming from the `sttp.client` package. +To set a multipart body on a request, the `multipartBody` method should be used (instead of `body`). Each body part is represented as an instance of `Part[BasicRequestBody]`, which can be conveniently constructed using `multipart` methods coming from the `sttp.client3` package. A single part of a multipart request consist of a mandatory name and a payload of type: @@ -18,7 +18,7 @@ The content type of each part is by default the same as when setting simple bodi The parts can be specified using either a `Seq[Multipart]` or by using multiple arguments: ```scala -import sttp.client._ +import sttp.client3._ basicRequest.multipartBody(Seq(multipart("p1", "v1"), multipart("p2", "v2"))) basicRequest.multipartBody(multipart("p1", "v1"), multipart("p2", "v2")) @@ -27,7 +27,7 @@ basicRequest.multipartBody(multipart("p1", "v1"), multipart("p2", "v2")) For example: ```scala -import sttp.client._ +import sttp.client3._ import java.io._ val someFile = new File("/sample/path") @@ -44,7 +44,7 @@ basicRequest.multipartBody( For each part, an optional filename can be specified, as well as a custom content type and additional headers. For example: ```scala -import sttp.client._ +import sttp.client3._ import java.io._ val logoFile = new File("/sample/path/logo123.jpg") diff --git a/generated-docs/out/requests/streaming.md b/generated-docs/out/requests/streaming.md index 9d5ab0303c..b4b0257a06 100644 --- a/generated-docs/out/requests/streaming.md +++ b/generated-docs/out/requests/streaming.md @@ -13,7 +13,7 @@ An implementation of the `Streams[S]` capability must be passed to the `.streamB For example, using the [akka-http backend](../backends/akka.md), a request with a streaming body can be defined as follows: ```scala -import sttp.client._ +import sttp.client3._ import sttp.capabilities.akka.AkkaStreams import akka.stream.scaladsl.Source diff --git a/generated-docs/out/responses/basics.md b/generated-docs/out/responses/basics.md index 0c10320df2..8ed29aa6c6 100644 --- a/generated-docs/out/responses/basics.md +++ b/generated-docs/out/responses/basics.md @@ -20,7 +20,7 @@ Individual headers can be obtained using the methods: ```scala import sttp.model._ -import sttp.client._ +import sttp.client3._ val backend = HttpURLConnectionBackend() val request = basicRequest .get(uri"http://endpoint.com/example") diff --git a/generated-docs/out/responses/body.md b/generated-docs/out/responses/body.md index 1f16a1c317..de05b17f76 100644 --- a/generated-docs/out/responses/body.md +++ b/generated-docs/out/responses/body.md @@ -14,7 +14,7 @@ How the response body will be read is part of the request description, as alread To conveniently specify how to deserialize the response body, a number of `as(...Type...)` methods are available. They can be used to provide a value for the request description's `response` property: ```scala -import sttp.client._ +import sttp.client3._ basicRequest.response(asByteArray) ``` @@ -24,7 +24,7 @@ When the above request is completely described and sent, it will result in a `Re Other possible response descriptions include (the first type parameter of `ResponseAs` specifies the type returned as the response body, the second - the capabilities that the backend is required to support to send the request; `Any` means no special requirements): ```scala -import sttp.client._ +import sttp.client3._ import java.io.File import java.nio.file.Path @@ -56,7 +56,7 @@ def asBothOption[A, B, R](l: ResponseAs[A, R], r: ResponseAs[B, Any]): ResponseA Hence, to discard the response body, the request description should include the following: ```scala -import sttp.client._ +import sttp.client3._ basicRequest.response(ignore) ``` @@ -64,7 +64,7 @@ basicRequest.response(ignore) And to save the response to a file: ```scala -import sttp.client._ +import sttp.client3._ import java.io._ val someFile = new File("some/path") @@ -80,7 +80,7 @@ basicRequest.response(asFile(someFile)) Sometimes it's convenient to get a failed effect (or an exception thrown) when the response status code is not successful. In such cases, the response specification can be modified using the `.getRight` combinator: ```scala -import sttp.client._ +import sttp.client3._ basicRequest.response(asString.getRight): PartialRequest[String, Any] ``` @@ -102,7 +102,7 @@ It's possible to define custom body deserializers by taking any of the built-in As an example, to read the response body as an int, the following response description can be defined (warning: this ignores the possibility of exceptions!): ```scala -import sttp.client._ +import sttp.client3._ val asInt: ResponseAs[Either[String, Int], Any] = asString.mapRight(_.toInt) @@ -114,7 +114,7 @@ basicRequest To integrate with a third-party JSON library, and always parse the response as a json (regardless of the status code): ```scala -import sttp.client._ +import sttp.client3._ type JsonError type JsonAST @@ -135,9 +135,9 @@ Using the `fromMetadata` combinator, it's possible to dynamically specify how th A more complex case, which uses Circe for deserializing JSON, choosing to which model to deserialize to depending on the status code, can look as following: ```scala -import sttp.client._ +import sttp.client3._ import sttp.model._ -import sttp.client.circe._ +import sttp.client3.circe._ import io.circe._ import io.circe.generic.auto._ @@ -157,9 +157,9 @@ val myRequest: Request[Either[ResponseException[String, io.circe.Error], MyModel The above example assumes that success and error models are part of one hierarchy (`MyModel`). Sometimes http errors are modelled independently of success. In this case, we can use `asJsonEither`, which uses `asEitherDeserialized` under the covers: ```scala -import sttp.client._ +import sttp.client3._ import sttp.model._ -import sttp.client.circe._ +import sttp.client3.circe._ import io.circe._ import io.circe.generic.auto._ @@ -180,7 +180,7 @@ If the backend used supports streaming (see [backends summary](../backends/summa ```scala import sttp.capabilities.{Effect, Streams} -import sttp.client._ +import sttp.client3._ def asStream[F[_], T, S](s: Streams[S])(f: s.BinaryStream => F[T]): ResponseAs[Either[String, T], Effect[F] with S] = ??? @@ -208,8 +208,8 @@ import akka.stream.scaladsl.Source import akka.util.ByteString import scala.concurrent.Future import sttp.capabilities.akka.AkkaStreams -import sttp.client._ -import sttp.client.akkahttp.AkkaHttpBackend +import sttp.client3._ +import sttp.client3.akkahttp.AkkaHttpBackend val backend: SttpBackend[Future, AkkaStreams] = AkkaHttpBackend() diff --git a/generated-docs/out/responses/exceptions.md b/generated-docs/out/responses/exceptions.md index 858dcceb3f..73a5295cb1 100644 --- a/generated-docs/out/responses/exceptions.md +++ b/generated-docs/out/responses/exceptions.md @@ -23,7 +23,7 @@ Exceptions might also be thrown when deserializing the response body - depending This means that a typical `asJson` response specification will result in the body being read as: ```scala -import sttp.client._ +import sttp.client3._ def asJson[T]: ResponseAs[Either[ResponseException[String, Exception], T], Any] = ??? ``` diff --git a/generated-docs/out/testing.md b/generated-docs/out/testing.md index c1cbdd2a6f..2303c42c8a 100644 --- a/generated-docs/out/testing.md +++ b/generated-docs/out/testing.md @@ -16,9 +16,9 @@ An empty backend stub can be created using the following ways: Some code which will be reused among following examples: ```scala -import sttp.client._ +import sttp.client3._ import sttp.model._ -import sttp.client.testing._ +import sttp.client3.testing._ import java.io.File import scala.concurrent.Future import scala.concurrent.ExecutionContext.Implicits.global @@ -118,7 +118,7 @@ basicRequest.get(uri"http://example.org").send(testingBackend) // code wil basicRequest.get(uri"http://example.org").send(testingBackend) // code will be 200 ``` -The `sttp.client.testing` package also contains a utility method to force the body as a string, if the body is not a stream or multipart: +The `sttp.client3.testing` package also contains a utility method to force the body as a string, if the body is not a stream or multipart: ```scala val testingBackend = SttpBackendStub.synchronous @@ -200,7 +200,7 @@ If you actually want a file to be written you can set up the stub like this: ```scala import org.apache.commons.io.FileUtils import cats.effect._ -import sttp.client.impl.cats.implicits._ +import sttp.client3.impl.cats.implicits._ import sttp.monad.MonadAsyncError implicit val cs: ContextShift[IO] = IO.contextShift(scala.concurrent.ExecutionContext.global) diff --git a/generated-docs/out/websockets.md b/generated-docs/out/websockets.md index 45a8b906cf..1337aad87d 100644 --- a/generated-docs/out/websockets.md +++ b/generated-docs/out/websockets.md @@ -6,7 +6,7 @@ A websocket request will be sent instead of a regular one if the response specif ## Using `WebSocket` -The first possibility is using `sttp.client.ws.WebSocket[F]`, where `F` is the backend-specific effects wrapper, such as `Future` or `IO`. It contains two basic methods, both of which use the `F` effect to return results: +The first possibility is using `sttp.client3.ws.WebSocket[F]`, where `F` is the backend-specific effects wrapper, such as `Future` or `IO`. It contains two basic methods, both of which use the `F` effect to return results: * `def receive: F[WebSocketFrame.Incoming]` which will complete once a message is available, and return the next incoming frame (which can be a data, ping, pong or close) * `def send(f: WebSocketFrame, isContinuation: Boolean = false): F[Unit]`, which sends a message to the websocket. The `WebSocketFrame` companion object contains methods for creating binary/text messages. When using fragmentation, the first message should be sent using `finalFragment = false`, and subsequent messages using `isContinuation = true`. @@ -16,7 +16,7 @@ The `WebSocket` trait also contains other methods for receiving only text/binary The following response specifications which use `WebSocket[F]` are available (the first type parameter of `ResponseAs` specifies the type returned as the response body, the second - the capabilities that the backend is required to support to send the request): ```mdoc:compile-only -import sttp.client._ +import sttp.client3._ def asWebSocket[F[_], T](f: WebSocket[F] => F[T]): ResponseAs[Either[String, T], Effect[F] with WebSockets] = ??? @@ -62,8 +62,8 @@ These methods can be found in corresponding WebSockets classes for given effect ================ ========================================== effect type class name ================ ========================================== -``monix.Task`` ``sttp.client.impl.monix.MonixWebSockets`` -``ZIO`` ``sttp.client.impl.zio.ZioWebSockets`` -``fs2.Stream`` ``sttp.client.impl.fs2.Fs2WebSockets`` +``monix.Task`` ``sttp.client3.impl.monix.MonixWebSockets`` +``ZIO`` ``sttp.client3.impl.zio.ZioWebSockets`` +``fs2.Stream`` ``sttp.client3.impl.fs2.Fs2WebSockets`` ================ ========================================== ``` diff --git a/http4s-backend/src/main/scala/sttp/client/http4s/Http4sBackend.scala b/http4s-backend/src/main/scala/sttp/client3/http4s/Http4sBackend.scala similarity index 97% rename from http4s-backend/src/main/scala/sttp/client/http4s/Http4sBackend.scala rename to http4s-backend/src/main/scala/sttp/client3/http4s/Http4sBackend.scala index 2c29b52395..a6b7455989 100644 --- a/http4s-backend/src/main/scala/sttp/client/http4s/Http4sBackend.scala +++ b/http4s-backend/src/main/scala/sttp/client3/http4s/Http4sBackend.scala @@ -1,4 +1,4 @@ -package sttp.client.http4s +package sttp.client3.http4s import java.io.{File, InputStream, UnsupportedEncodingException} import java.nio.charset.Charset @@ -14,9 +14,9 @@ import org.http4s import org.http4s.client.Client import org.http4s.client.blaze.BlazeClientBuilder import sttp.capabilities.fs2.Fs2Streams -import sttp.client.http4s.Http4sBackend.EncodingHandler -import sttp.client.impl.cats.CatsMonadAsyncError -import sttp.client.internal.{ +import sttp.client3.http4s.Http4sBackend.EncodingHandler +import sttp.client3.impl.cats.CatsMonadAsyncError +import sttp.client3.internal.{ BodyFromResponseAs, IOBufferSize, ReplayableBody, @@ -27,9 +27,9 @@ import sttp.client.internal.{ } import sttp.model._ import sttp.monad.MonadError -import sttp.client.testing.SttpBackendStub -import sttp.client.ws.{GotAWebSocketException, NotAWebSocketException} -import sttp.client.{ +import sttp.client3.testing.SttpBackendStub +import sttp.client3.ws.{GotAWebSocketException, NotAWebSocketException} +import sttp.client3.{ BasicRequestBody, IgnoreResponse, NoBody, diff --git a/http4s-backend/src/test/scala/sttp/client/http4s/Http4sHttpStreamingTest.scala b/http4s-backend/src/test/scala/sttp/client3/http4s/Http4sHttpStreamingTest.scala similarity index 81% rename from http4s-backend/src/test/scala/sttp/client/http4s/Http4sHttpStreamingTest.scala rename to http4s-backend/src/test/scala/sttp/client3/http4s/Http4sHttpStreamingTest.scala index faef328408..685cc6fc4f 100644 --- a/http4s-backend/src/test/scala/sttp/client/http4s/Http4sHttpStreamingTest.scala +++ b/http4s-backend/src/test/scala/sttp/client3/http4s/Http4sHttpStreamingTest.scala @@ -1,8 +1,8 @@ -package sttp.client.http4s +package sttp.client3.http4s import cats.effect.IO -import sttp.client.SttpBackend -import sttp.client.impl.fs2.Fs2StreamingTest +import sttp.client3.SttpBackend +import sttp.client3.impl.fs2.Fs2StreamingTest import scala.concurrent.ExecutionContext import org.http4s.client.blaze.BlazeClientBuilder diff --git a/http4s-backend/src/test/scala/sttp/client/http4s/Http4sHttpTest.scala b/http4s-backend/src/test/scala/sttp/client3/http4s/Http4sHttpTest.scala similarity index 79% rename from http4s-backend/src/test/scala/sttp/client/http4s/Http4sHttpTest.scala rename to http4s-backend/src/test/scala/sttp/client3/http4s/Http4sHttpTest.scala index 7a43f45eaf..700026438d 100644 --- a/http4s-backend/src/test/scala/sttp/client/http4s/Http4sHttpTest.scala +++ b/http4s-backend/src/test/scala/sttp/client3/http4s/Http4sHttpTest.scala @@ -1,10 +1,10 @@ -package sttp.client.http4s +package sttp.client3.http4s import cats.effect.IO import org.http4s.client.blaze.BlazeClientBuilder -import sttp.client.SttpBackend -import sttp.client.impl.cats.CatsTestBase -import sttp.client.testing.HttpTest +import sttp.client3.SttpBackend +import sttp.client3.impl.cats.CatsTestBase +import sttp.client3.testing.HttpTest import scala.concurrent.ExecutionContext diff --git a/httpclient-backend/fs2/src/main/scala/sttp/client/httpclient/fs2/Fs2BodyFromHttpClient.scala b/httpclient-backend/fs2/src/main/scala/sttp/client3/httpclient/fs2/Fs2BodyFromHttpClient.scala similarity index 88% rename from httpclient-backend/fs2/src/main/scala/sttp/client/httpclient/fs2/Fs2BodyFromHttpClient.scala rename to httpclient-backend/fs2/src/main/scala/sttp/client3/httpclient/fs2/Fs2BodyFromHttpClient.scala index baafebb42e..9ce3313112 100644 --- a/httpclient-backend/fs2/src/main/scala/sttp/client/httpclient/fs2/Fs2BodyFromHttpClient.scala +++ b/httpclient-backend/fs2/src/main/scala/sttp/client3/httpclient/fs2/Fs2BodyFromHttpClient.scala @@ -1,14 +1,14 @@ -package sttp.client.httpclient.fs2 +package sttp.client3.httpclient.fs2 import cats.effect.{Blocker, ConcurrentEffect, ContextShift} import fs2.{Pipe, Stream} import sttp.capabilities.fs2.Fs2Streams -import sttp.client.httpclient.BodyFromHttpClient -import sttp.client.impl.cats.CatsMonadAsyncError -import sttp.client.impl.fs2.Fs2WebSockets -import sttp.client.internal.{BodyFromResponseAs, SttpFile} -import sttp.client.ws.{GotAWebSocketException, NotAWebSocketException} -import sttp.client.{ResponseMetadata, WebSocketResponseAs} +import sttp.client3.httpclient.BodyFromHttpClient +import sttp.client3.impl.cats.CatsMonadAsyncError +import sttp.client3.impl.fs2.Fs2WebSockets +import sttp.client3.internal.{BodyFromResponseAs, SttpFile} +import sttp.client3.ws.{GotAWebSocketException, NotAWebSocketException} +import sttp.client3.{ResponseMetadata, WebSocketResponseAs} import sttp.monad.MonadError import sttp.monad.syntax.{MonadErrorValueOps, _} import sttp.ws.{WebSocket, WebSocketFrame} diff --git a/httpclient-backend/fs2/src/main/scala/sttp/client/httpclient/fs2/HttpClientFs2Backend.scala b/httpclient-backend/fs2/src/main/scala/sttp/client3/httpclient/fs2/HttpClientFs2Backend.scala similarity index 89% rename from httpclient-backend/fs2/src/main/scala/sttp/client/httpclient/fs2/HttpClientFs2Backend.scala rename to httpclient-backend/fs2/src/main/scala/sttp/client3/httpclient/fs2/HttpClientFs2Backend.scala index 2f4532ca9e..1c3a60ab98 100644 --- a/httpclient-backend/fs2/src/main/scala/sttp/client/httpclient/fs2/HttpClientFs2Backend.scala +++ b/httpclient-backend/fs2/src/main/scala/sttp/client3/httpclient/fs2/HttpClientFs2Backend.scala @@ -1,4 +1,4 @@ -package sttp.client.httpclient.fs2 +package sttp.client3.httpclient.fs2 import java.io.UnsupportedEncodingException import java.net.http.HttpRequest.BodyPublishers @@ -15,14 +15,14 @@ import fs2.interop.reactivestreams._ import org.reactivestreams.{FlowAdapters, Publisher} import sttp.capabilities.WebSockets import sttp.capabilities.fs2.Fs2Streams -import sttp.client.httpclient.HttpClientBackend.EncodingHandler -import sttp.client.httpclient.fs2.HttpClientFs2Backend.Fs2EncodingHandler -import sttp.client.httpclient.{BodyFromHttpClient, BodyToHttpClient, HttpClientAsyncBackend, HttpClientBackend} -import sttp.client.impl.cats.implicits._ -import sttp.client.impl.fs2.Fs2SimpleQueue -import sttp.client.internal.ws.SimpleQueue -import sttp.client.testing.SttpBackendStub -import sttp.client.{FollowRedirectsBackend, Request, Response, SttpBackend, SttpBackendOptions} +import sttp.client3.httpclient.HttpClientBackend.EncodingHandler +import sttp.client3.httpclient.fs2.HttpClientFs2Backend.Fs2EncodingHandler +import sttp.client3.httpclient.{BodyFromHttpClient, BodyToHttpClient, HttpClientAsyncBackend, HttpClientBackend} +import sttp.client3.impl.cats.implicits._ +import sttp.client3.impl.fs2.Fs2SimpleQueue +import sttp.client3.internal.ws.SimpleQueue +import sttp.client3.testing.SttpBackendStub +import sttp.client3.{FollowRedirectsBackend, Request, Response, SttpBackend, SttpBackendOptions} import sttp.monad.MonadError import scala.collection.JavaConverters._ diff --git a/httpclient-backend/fs2/src/test/scala/sttp/client/httpclient/fs2/HttpClientFs2HttpTest.scala b/httpclient-backend/fs2/src/test/scala/sttp/client3/httpclient/fs2/HttpClientFs2HttpTest.scala similarity index 57% rename from httpclient-backend/fs2/src/test/scala/sttp/client/httpclient/fs2/HttpClientFs2HttpTest.scala rename to httpclient-backend/fs2/src/test/scala/sttp/client3/httpclient/fs2/HttpClientFs2HttpTest.scala index 516e44e113..472b64f762 100644 --- a/httpclient-backend/fs2/src/test/scala/sttp/client/httpclient/fs2/HttpClientFs2HttpTest.scala +++ b/httpclient-backend/fs2/src/test/scala/sttp/client3/httpclient/fs2/HttpClientFs2HttpTest.scala @@ -1,6 +1,6 @@ -package sttp.client.httpclient.fs2 +package sttp.client3.httpclient.fs2 import cats.effect.IO -import sttp.client.testing.HttpTest +import sttp.client3.testing.HttpTest class HttpClientFs2HttpTest extends HttpTest[IO] with HttpClientFs2TestBase diff --git a/httpclient-backend/fs2/src/test/scala/sttp/client/httpclient/fs2/HttpClientFs2StreamingTest.scala b/httpclient-backend/fs2/src/test/scala/sttp/client3/httpclient/fs2/HttpClientFs2StreamingTest.scala similarity index 66% rename from httpclient-backend/fs2/src/test/scala/sttp/client/httpclient/fs2/HttpClientFs2StreamingTest.scala rename to httpclient-backend/fs2/src/test/scala/sttp/client3/httpclient/fs2/HttpClientFs2StreamingTest.scala index 6479f4b7e2..9a39b3376b 100644 --- a/httpclient-backend/fs2/src/test/scala/sttp/client/httpclient/fs2/HttpClientFs2StreamingTest.scala +++ b/httpclient-backend/fs2/src/test/scala/sttp/client3/httpclient/fs2/HttpClientFs2StreamingTest.scala @@ -1,6 +1,6 @@ -package sttp.client.httpclient.fs2 +package sttp.client3.httpclient.fs2 -import sttp.client.impl.fs2.Fs2StreamingTest +import sttp.client3.impl.fs2.Fs2StreamingTest class HttpClientFs2StreamingTest extends Fs2StreamingTest with HttpClientFs2TestBase { override protected def supportsStreamingMultipartParts: Boolean = false diff --git a/httpclient-backend/fs2/src/test/scala/sttp/client/httpclient/fs2/HttpClientFs2TestBase.scala b/httpclient-backend/fs2/src/test/scala/sttp/client3/httpclient/fs2/HttpClientFs2TestBase.scala similarity index 73% rename from httpclient-backend/fs2/src/test/scala/sttp/client/httpclient/fs2/HttpClientFs2TestBase.scala rename to httpclient-backend/fs2/src/test/scala/sttp/client3/httpclient/fs2/HttpClientFs2TestBase.scala index 6bd2e86db8..fe3e5c9200 100644 --- a/httpclient-backend/fs2/src/test/scala/sttp/client/httpclient/fs2/HttpClientFs2TestBase.scala +++ b/httpclient-backend/fs2/src/test/scala/sttp/client3/httpclient/fs2/HttpClientFs2TestBase.scala @@ -1,10 +1,10 @@ -package sttp.client.httpclient.fs2 +package sttp.client3.httpclient.fs2 import cats.effect.IO import sttp.capabilities.WebSockets import sttp.capabilities.fs2.Fs2Streams -import sttp.client._ -import sttp.client.impl.cats.CatsTestBase +import sttp.client3._ +import sttp.client3.impl.cats.CatsTestBase trait HttpClientFs2TestBase extends CatsTestBase { implicit val backend: SttpBackend[IO, Fs2Streams[IO] with WebSockets] = diff --git a/httpclient-backend/fs2/src/test/scala/sttp/client/httpclient/fs2/HttpClientFs2WebSocketTest.scala b/httpclient-backend/fs2/src/test/scala/sttp/client3/httpclient/fs2/HttpClientFs2WebSocketTest.scala similarity index 59% rename from httpclient-backend/fs2/src/test/scala/sttp/client/httpclient/fs2/HttpClientFs2WebSocketTest.scala rename to httpclient-backend/fs2/src/test/scala/sttp/client3/httpclient/fs2/HttpClientFs2WebSocketTest.scala index 36177d5b95..eb9873a048 100644 --- a/httpclient-backend/fs2/src/test/scala/sttp/client/httpclient/fs2/HttpClientFs2WebSocketTest.scala +++ b/httpclient-backend/fs2/src/test/scala/sttp/client3/httpclient/fs2/HttpClientFs2WebSocketTest.scala @@ -1,11 +1,11 @@ -package sttp.client.httpclient.fs2 +package sttp.client3.httpclient.fs2 import cats.effect.IO import cats.implicits._ import fs2.Pipe import sttp.capabilities.fs2.Fs2Streams -import sttp.client.impl.fs2.Fs2WebSockets -import sttp.client.testing.websocket.{WebSocketStreamingTest, WebSocketTest} +import sttp.client3.impl.fs2.Fs2WebSockets +import sttp.client3.testing.websocket.{WebSocketStreamingTest, WebSocketTest} import sttp.ws.WebSocketFrame class HttpClientFs2WebSocketTest @@ -19,11 +19,13 @@ class HttpClientFs2WebSocketTest ): fs2.Pipe[IO, WebSocketFrame.Data[_], WebSocketFrame] = in => in.mapFilter(f) override def fromTextPipe( - function: String => WebSocketFrame - ): Pipe[IO, WebSocketFrame.Data[_], WebSocketFrame] = + function: String => WebSocketFrame + ): Pipe[IO, WebSocketFrame.Data[_], WebSocketFrame] = Fs2WebSockets.fromTextPipe[IO](function) - override def prepend(item: WebSocketFrame.Text)(to: Pipe[IO, WebSocketFrame.Data[_], WebSocketFrame]): Pipe[IO, WebSocketFrame.Data[_], WebSocketFrame] = { + override def prepend( + item: WebSocketFrame.Text + )(to: Pipe[IO, WebSocketFrame.Data[_], WebSocketFrame]): Pipe[IO, WebSocketFrame.Data[_], WebSocketFrame] = { to.andThen(rest => fs2.Stream.eval(item.pure[IO]) ++ rest) } } diff --git a/httpclient-backend/monix/src/main/scala/sttp/client/httpclient/monix/HttpClientMonixBackend.scala b/httpclient-backend/monix/src/main/scala/sttp/client3/httpclient/monix/HttpClientMonixBackend.scala similarity index 91% rename from httpclient-backend/monix/src/main/scala/sttp/client/httpclient/monix/HttpClientMonixBackend.scala rename to httpclient-backend/monix/src/main/scala/sttp/client3/httpclient/monix/HttpClientMonixBackend.scala index 37ec076db7..2cd4c27b4a 100644 --- a/httpclient-backend/monix/src/main/scala/sttp/client/httpclient/monix/HttpClientMonixBackend.scala +++ b/httpclient-backend/monix/src/main/scala/sttp/client3/httpclient/monix/HttpClientMonixBackend.scala @@ -1,4 +1,4 @@ -package sttp.client.httpclient.monix +package sttp.client3.httpclient.monix import java.io.{InputStream, UnsupportedEncodingException} import java.net.http.HttpRequest.BodyPublishers @@ -14,14 +14,14 @@ import monix.reactive.Observable import org.reactivestreams.{FlowAdapters, Publisher} import sttp.capabilities.WebSockets import sttp.capabilities.monix.MonixStreams -import sttp.client.httpclient.HttpClientBackend.EncodingHandler -import sttp.client.httpclient.monix.HttpClientMonixBackend.MonixEncodingHandler -import sttp.client.httpclient._ -import sttp.client.impl.monix.{MonixSimpleQueue, MonixWebSockets, TaskMonadAsyncError} -import sttp.client.internal._ -import sttp.client.internal.ws.SimpleQueue -import sttp.client.testing.SttpBackendStub -import sttp.client.{FollowRedirectsBackend, SttpBackend, SttpBackendOptions} +import sttp.client3.httpclient.HttpClientBackend.EncodingHandler +import sttp.client3.httpclient.monix.HttpClientMonixBackend.MonixEncodingHandler +import sttp.client3.httpclient._ +import sttp.client3.impl.monix.{MonixSimpleQueue, MonixWebSockets, TaskMonadAsyncError} +import sttp.client3.internal._ +import sttp.client3.internal.ws.SimpleQueue +import sttp.client3.testing.SttpBackendStub +import sttp.client3.{FollowRedirectsBackend, SttpBackend, SttpBackendOptions} import sttp.monad.MonadError import sttp.ws.{WebSocket, WebSocketFrame} diff --git a/httpclient-backend/monix/src/test/scala/sttp/client/httpclient/monix/HttpClientMonixHttpTest.scala b/httpclient-backend/monix/src/test/scala/sttp/client3/httpclient/monix/HttpClientMonixHttpTest.scala similarity index 63% rename from httpclient-backend/monix/src/test/scala/sttp/client/httpclient/monix/HttpClientMonixHttpTest.scala rename to httpclient-backend/monix/src/test/scala/sttp/client3/httpclient/monix/HttpClientMonixHttpTest.scala index 63c450aa41..5c22a2cc15 100644 --- a/httpclient-backend/monix/src/test/scala/sttp/client/httpclient/monix/HttpClientMonixHttpTest.scala +++ b/httpclient-backend/monix/src/test/scala/sttp/client3/httpclient/monix/HttpClientMonixHttpTest.scala @@ -1,9 +1,9 @@ -package sttp.client.httpclient.monix +package sttp.client3.httpclient.monix import monix.eval.Task -import sttp.client.impl.monix.convertMonixTaskToFuture -import sttp.client.testing.{ConvertToFuture, HttpTest} -import sttp.client.SttpBackend +import sttp.client3.impl.monix.convertMonixTaskToFuture +import sttp.client3.testing.{ConvertToFuture, HttpTest} +import sttp.client3.SttpBackend import monix.execution.Scheduler.Implicits.global class HttpClientMonixHttpTest extends HttpTest[Task] { diff --git a/httpclient-backend/monix/src/test/scala/sttp/client/httpclient/monix/HttpClientMonixStreamingTest.scala b/httpclient-backend/monix/src/test/scala/sttp/client3/httpclient/monix/HttpClientMonixStreamingTest.scala similarity index 75% rename from httpclient-backend/monix/src/test/scala/sttp/client/httpclient/monix/HttpClientMonixStreamingTest.scala rename to httpclient-backend/monix/src/test/scala/sttp/client3/httpclient/monix/HttpClientMonixStreamingTest.scala index dfb9e3babe..7048d97da5 100644 --- a/httpclient-backend/monix/src/test/scala/sttp/client/httpclient/monix/HttpClientMonixStreamingTest.scala +++ b/httpclient-backend/monix/src/test/scala/sttp/client3/httpclient/monix/HttpClientMonixStreamingTest.scala @@ -1,8 +1,8 @@ -package sttp.client.httpclient.monix +package sttp.client3.httpclient.monix import monix.eval.Task -import sttp.client.impl.monix.MonixStreamingTest -import sttp.client.SttpBackend +import sttp.client3.impl.monix.MonixStreamingTest +import sttp.client3.SttpBackend import monix.execution.Scheduler.Implicits.global import sttp.capabilities.monix.MonixStreams diff --git a/httpclient-backend/monix/src/test/scala/sttp/client/httpclient/monix/HttpClientMonixWebSocketTest.scala b/httpclient-backend/monix/src/test/scala/sttp/client3/httpclient/monix/HttpClientMonixWebSocketTest.scala similarity index 82% rename from httpclient-backend/monix/src/test/scala/sttp/client/httpclient/monix/HttpClientMonixWebSocketTest.scala rename to httpclient-backend/monix/src/test/scala/sttp/client3/httpclient/monix/HttpClientMonixWebSocketTest.scala index ffe53271c6..3da8eda7e2 100644 --- a/httpclient-backend/monix/src/test/scala/sttp/client/httpclient/monix/HttpClientMonixWebSocketTest.scala +++ b/httpclient-backend/monix/src/test/scala/sttp/client3/httpclient/monix/HttpClientMonixWebSocketTest.scala @@ -1,14 +1,14 @@ -package sttp.client.httpclient.monix +package sttp.client3.httpclient.monix import monix.eval.Task import monix.execution.Scheduler.Implicits.global import monix.reactive.Observable import sttp.capabilities.WebSockets import sttp.capabilities.monix.MonixStreams -import sttp.client._ -import sttp.client.impl.monix.{MonixWebSockets, TaskMonadAsyncError, convertMonixTaskToFuture} -import sttp.client.testing.ConvertToFuture -import sttp.client.testing.websocket.{WebSocketStreamingTest, WebSocketTest} +import sttp.client3._ +import sttp.client3.impl.monix.{MonixWebSockets, TaskMonadAsyncError, convertMonixTaskToFuture} +import sttp.client3.testing.ConvertToFuture +import sttp.client3.testing.websocket.{WebSocketStreamingTest, WebSocketTest} import sttp.monad.MonadError import sttp.ws.WebSocketFrame diff --git a/httpclient-backend/src/main/scala/sttp/client/httpclient/BodyFromHttpClient.scala b/httpclient-backend/src/main/scala/sttp/client3/httpclient/BodyFromHttpClient.scala similarity index 92% rename from httpclient-backend/src/main/scala/sttp/client/httpclient/BodyFromHttpClient.scala rename to httpclient-backend/src/main/scala/sttp/client3/httpclient/BodyFromHttpClient.scala index 0b406c9db2..b5eb4d628e 100644 --- a/httpclient-backend/src/main/scala/sttp/client/httpclient/BodyFromHttpClient.scala +++ b/httpclient-backend/src/main/scala/sttp/client3/httpclient/BodyFromHttpClient.scala @@ -1,8 +1,8 @@ -package sttp.client.httpclient +package sttp.client3.httpclient import sttp.capabilities.Streams -import sttp.client.internal.BodyFromResponseAs -import sttp.client.{ +import sttp.client3.internal.BodyFromResponseAs +import sttp.client3.{ ResponseAs, ResponseAsWebSocket, ResponseAsWebSocketStream, diff --git a/httpclient-backend/src/main/scala/sttp/client/httpclient/BodyToHttpClient.scala b/httpclient-backend/src/main/scala/sttp/client3/httpclient/BodyToHttpClient.scala similarity index 97% rename from httpclient-backend/src/main/scala/sttp/client/httpclient/BodyToHttpClient.scala rename to httpclient-backend/src/main/scala/sttp/client3/httpclient/BodyToHttpClient.scala index efef58cb42..d50f9fd11f 100644 --- a/httpclient-backend/src/main/scala/sttp/client/httpclient/BodyToHttpClient.scala +++ b/httpclient-backend/src/main/scala/sttp/client3/httpclient/BodyToHttpClient.scala @@ -1,4 +1,4 @@ -package sttp.client.httpclient +package sttp.client3.httpclient import java.io.{ByteArrayInputStream, InputStream} import java.net.http.HttpRequest @@ -7,8 +7,8 @@ import java.nio.{Buffer, ByteBuffer} import java.util.function.Supplier import sttp.capabilities.Streams -import sttp.client.internal.throwNestedMultipartNotAllowed -import sttp.client.{ +import sttp.client3.internal.throwNestedMultipartNotAllowed +import sttp.client3.{ BasicRequestBody, ByteArrayBody, ByteBufferBody, diff --git a/httpclient-backend/src/main/scala/sttp/client/httpclient/DelegatingWebSocketListener.scala b/httpclient-backend/src/main/scala/sttp/client3/httpclient/DelegatingWebSocketListener.scala similarity index 97% rename from httpclient-backend/src/main/scala/sttp/client/httpclient/DelegatingWebSocketListener.scala rename to httpclient-backend/src/main/scala/sttp/client3/httpclient/DelegatingWebSocketListener.scala index c64848268f..3e336d3baf 100644 --- a/httpclient-backend/src/main/scala/sttp/client/httpclient/DelegatingWebSocketListener.scala +++ b/httpclient-backend/src/main/scala/sttp/client3/httpclient/DelegatingWebSocketListener.scala @@ -1,4 +1,4 @@ -package sttp.client.httpclient +package sttp.client3.httpclient import java.net.http.WebSocket import java.net.http.WebSocket.Listener diff --git a/httpclient-backend/src/main/scala/sttp/client/httpclient/HttpClientAsyncBackend.scala b/httpclient-backend/src/main/scala/sttp/client3/httpclient/HttpClientAsyncBackend.scala similarity index 94% rename from httpclient-backend/src/main/scala/sttp/client/httpclient/HttpClientAsyncBackend.scala rename to httpclient-backend/src/main/scala/sttp/client3/httpclient/HttpClientAsyncBackend.scala index 620be609fb..ab70ff08c3 100644 --- a/httpclient-backend/src/main/scala/sttp/client/httpclient/HttpClientAsyncBackend.scala +++ b/httpclient-backend/src/main/scala/sttp/client3/httpclient/HttpClientAsyncBackend.scala @@ -1,4 +1,4 @@ -package sttp.client.httpclient +package sttp.client3.httpclient import java.net.http.HttpResponse.BodyHandlers import java.net.http.{HttpClient, HttpRequest, HttpResponse, WebSocketHandshakeException} @@ -8,9 +8,9 @@ import java.util.concurrent.{CompletionException, Flow} import java.{util => ju} import org.reactivestreams.{FlowAdapters, Publisher} -import sttp.client.httpclient.HttpClientBackend.EncodingHandler -import sttp.client.internal.ws.{SimpleQueue, WebSocketEvent} -import sttp.client.{Request, Response, SttpClientException} +import sttp.client3.httpclient.HttpClientBackend.EncodingHandler +import sttp.client3.internal.ws.{SimpleQueue, WebSocketEvent} +import sttp.client3.{Request, Response, SttpClientException} import sttp.model.StatusCode import sttp.monad.syntax._ import sttp.monad.{Canceler, MonadAsyncError, MonadError} diff --git a/httpclient-backend/src/main/scala/sttp/client/httpclient/HttpClientBackend.scala b/httpclient-backend/src/main/scala/sttp/client3/httpclient/HttpClientBackend.scala similarity index 94% rename from httpclient-backend/src/main/scala/sttp/client/httpclient/HttpClientBackend.scala rename to httpclient-backend/src/main/scala/sttp/client3/httpclient/HttpClientBackend.scala index 6804ba7e73..a69ae018a9 100644 --- a/httpclient-backend/src/main/scala/sttp/client/httpclient/HttpClientBackend.scala +++ b/httpclient-backend/src/main/scala/sttp/client3/httpclient/HttpClientBackend.scala @@ -1,4 +1,4 @@ -package sttp.client.httpclient +package sttp.client3.httpclient import java.io.{InputStream, UnsupportedEncodingException} import java.net.http.{HttpClient, HttpRequest, HttpResponse} @@ -10,11 +10,11 @@ import java.util.function import java.util.zip.{GZIPInputStream, InflaterInputStream} import sttp.capabilities.{Effect, Streams} -import sttp.client.SttpBackendOptions.Proxy -import sttp.client.httpclient.HttpClientBackend.EncodingHandler +import sttp.client3.SttpBackendOptions.Proxy +import sttp.client3.httpclient.HttpClientBackend.EncodingHandler import sttp.monad.MonadError import sttp.monad.syntax._ -import sttp.client.{MultipartBody, Request, Response, ResponseAs, ResponseMetadata, SttpBackend, SttpBackendOptions} +import sttp.client3.{MultipartBody, Request, Response, ResponseAs, ResponseMetadata, SttpBackend, SttpBackendOptions} import sttp.model._ import sttp.ws.WebSocket diff --git a/httpclient-backend/src/main/scala/sttp/client/httpclient/HttpClientFutureBackend.scala b/httpclient-backend/src/main/scala/sttp/client3/httpclient/HttpClientFutureBackend.scala similarity index 91% rename from httpclient-backend/src/main/scala/sttp/client/httpclient/HttpClientFutureBackend.scala rename to httpclient-backend/src/main/scala/sttp/client3/httpclient/HttpClientFutureBackend.scala index 77caee0a27..a8d7bdb5f3 100644 --- a/httpclient-backend/src/main/scala/sttp/client/httpclient/HttpClientFutureBackend.scala +++ b/httpclient-backend/src/main/scala/sttp/client3/httpclient/HttpClientFutureBackend.scala @@ -1,4 +1,4 @@ -package sttp.client.httpclient +package sttp.client3.httpclient import java.io.{InputStream, UnsupportedEncodingException} import java.net.http.HttpRequest.BodyPublisher @@ -9,12 +9,12 @@ import java.util.zip.{GZIPInputStream, InflaterInputStream} import org.reactivestreams.Publisher import sttp.capabilities.WebSockets -import sttp.client.httpclient.HttpClientBackend.EncodingHandler -import sttp.client.httpclient.HttpClientFutureBackend.InputStreamEncodingHandler -import sttp.client.internal.ws.{FutureSimpleQueue, SimpleQueue} -import sttp.client.internal.{NoStreams, emptyInputStream} -import sttp.client.testing.SttpBackendStub -import sttp.client.{FollowRedirectsBackend, SttpBackend, SttpBackendOptions} +import sttp.client3.httpclient.HttpClientBackend.EncodingHandler +import sttp.client3.httpclient.HttpClientFutureBackend.InputStreamEncodingHandler +import sttp.client3.internal.ws.{FutureSimpleQueue, SimpleQueue} +import sttp.client3.internal.{NoStreams, emptyInputStream} +import sttp.client3.testing.SttpBackendStub +import sttp.client3.{FollowRedirectsBackend, SttpBackend, SttpBackendOptions} import sttp.monad.{FutureMonad, MonadError} import sttp.ws.{WebSocket, WebSocketFrame} diff --git a/httpclient-backend/src/main/scala/sttp/client/httpclient/HttpClientSyncBackend.scala b/httpclient-backend/src/main/scala/sttp/client3/httpclient/HttpClientSyncBackend.scala similarity index 93% rename from httpclient-backend/src/main/scala/sttp/client/httpclient/HttpClientSyncBackend.scala rename to httpclient-backend/src/main/scala/sttp/client3/httpclient/HttpClientSyncBackend.scala index d30d832bfb..77f2295489 100644 --- a/httpclient-backend/src/main/scala/sttp/client/httpclient/HttpClientSyncBackend.scala +++ b/httpclient-backend/src/main/scala/sttp/client3/httpclient/HttpClientSyncBackend.scala @@ -1,4 +1,4 @@ -package sttp.client.httpclient +package sttp.client3.httpclient import java.io.{InputStream, UnsupportedEncodingException} import java.net.http.HttpRequest.BodyPublisher @@ -6,12 +6,12 @@ import java.net.http.HttpResponse.BodyHandlers import java.net.http.{HttpClient, HttpRequest} import java.util.zip.{GZIPInputStream, InflaterInputStream} -import sttp.client.httpclient.HttpClientBackend.EncodingHandler -import sttp.client.httpclient.HttpClientSyncBackend.SyncEncodingHandler -import sttp.client.internal.NoStreams -import sttp.client.monad.IdMonad -import sttp.client.testing.SttpBackendStub -import sttp.client.{ +import sttp.client3.httpclient.HttpClientBackend.EncodingHandler +import sttp.client3.httpclient.HttpClientSyncBackend.SyncEncodingHandler +import sttp.client3.internal.NoStreams +import sttp.client3.monad.IdMonad +import sttp.client3.testing.SttpBackendStub +import sttp.client3.{ FollowRedirectsBackend, Identity, Request, diff --git a/httpclient-backend/src/main/scala/sttp/client/httpclient/InputStreamBodyFromHttpClient.scala b/httpclient-backend/src/main/scala/sttp/client3/httpclient/InputStreamBodyFromHttpClient.scala similarity index 89% rename from httpclient-backend/src/main/scala/sttp/client/httpclient/InputStreamBodyFromHttpClient.scala rename to httpclient-backend/src/main/scala/sttp/client3/httpclient/InputStreamBodyFromHttpClient.scala index d24416d52e..cdbff158ff 100644 --- a/httpclient-backend/src/main/scala/sttp/client/httpclient/InputStreamBodyFromHttpClient.scala +++ b/httpclient-backend/src/main/scala/sttp/client3/httpclient/InputStreamBodyFromHttpClient.scala @@ -1,10 +1,10 @@ -package sttp.client.httpclient +package sttp.client3.httpclient import java.io.{BufferedInputStream, ByteArrayInputStream, FileInputStream, InputStream} -import sttp.client.internal.{BodyFromResponseAs, FileHelpers, SttpFile} -import sttp.client.ws.{GotAWebSocketException, NotAWebSocketException} -import sttp.client.{ResponseMetadata, WebSocketResponseAs} +import sttp.client3.internal.{BodyFromResponseAs, FileHelpers, SttpFile} +import sttp.client3.ws.{GotAWebSocketException, NotAWebSocketException} +import sttp.client3.{ResponseMetadata, WebSocketResponseAs} import sttp.monad.syntax.MonadErrorValueOps import sttp.ws.WebSocket diff --git a/httpclient-backend/src/main/scala/sttp/client/httpclient/InputStreamSubscriber.scala b/httpclient-backend/src/main/scala/sttp/client3/httpclient/InputStreamSubscriber.scala similarity index 97% rename from httpclient-backend/src/main/scala/sttp/client/httpclient/InputStreamSubscriber.scala rename to httpclient-backend/src/main/scala/sttp/client3/httpclient/InputStreamSubscriber.scala index 991f521a1d..e13f06c6b0 100644 --- a/httpclient-backend/src/main/scala/sttp/client/httpclient/InputStreamSubscriber.scala +++ b/httpclient-backend/src/main/scala/sttp/client3/httpclient/InputStreamSubscriber.scala @@ -1,4 +1,4 @@ -package sttp.client.httpclient +package sttp.client3.httpclient import java.io.InputStream import java.nio.ByteBuffer @@ -9,7 +9,7 @@ import java.util.function.UnaryOperator import java.util.stream.{Collector, Collectors} import org.reactivestreams.{Subscriber, Subscription} -import sttp.client.httpclient.InputStreamSubscriber._ +import sttp.client3.httpclient.InputStreamSubscriber._ // based on org.asynchttpclient.request.body.generator.ReactiveStreamsBodyGenerator.SimpleSubscriber private[httpclient] class InputStreamSubscriber extends Subscriber[java.util.List[ByteBuffer]] { diff --git a/httpclient-backend/src/main/scala/sttp/client/httpclient/MultiPartBodyPublisher.java b/httpclient-backend/src/main/scala/sttp/client3/httpclient/MultiPartBodyPublisher.java similarity index 99% rename from httpclient-backend/src/main/scala/sttp/client/httpclient/MultiPartBodyPublisher.java rename to httpclient-backend/src/main/scala/sttp/client3/httpclient/MultiPartBodyPublisher.java index b40b29ac31..7775150732 100644 --- a/httpclient-backend/src/main/scala/sttp/client/httpclient/MultiPartBodyPublisher.java +++ b/httpclient-backend/src/main/scala/sttp/client3/httpclient/MultiPartBodyPublisher.java @@ -1,4 +1,4 @@ -package sttp.client.httpclient; +package sttp.client3.httpclient; import java.io.IOException; import java.io.InputStream; diff --git a/httpclient-backend/src/main/scala/sttp/client/httpclient/WebSocketImpl.scala b/httpclient-backend/src/main/scala/sttp/client3/httpclient/WebSocketImpl.scala similarity index 97% rename from httpclient-backend/src/main/scala/sttp/client/httpclient/WebSocketImpl.scala rename to httpclient-backend/src/main/scala/sttp/client3/httpclient/WebSocketImpl.scala index 1abf387958..25fd53de42 100644 --- a/httpclient-backend/src/main/scala/sttp/client/httpclient/WebSocketImpl.scala +++ b/httpclient-backend/src/main/scala/sttp/client3/httpclient/WebSocketImpl.scala @@ -1,4 +1,4 @@ -package sttp.client.httpclient +package sttp.client3.httpclient import java.net.http.WebSocket.Listener import java.nio.ByteBuffer @@ -7,7 +7,7 @@ import java.util.concurrent.atomic.AtomicBoolean import java.util.function.BiConsumer import java.net.http.{WebSocket => JWebSocket} -import sttp.client.internal.ws.{SimpleQueue, WebSocketEvent} +import sttp.client3.internal.ws.{SimpleQueue, WebSocketEvent} import sttp.model.Headers import sttp.monad.{Canceler, MonadAsyncError, MonadError} import sttp.monad.syntax._ diff --git a/httpclient-backend/src/test/scala/sttp/client/httpclient/HttpClientFutureHttpTest.scala b/httpclient-backend/src/test/scala/sttp/client3/httpclient/HttpClientFutureHttpTest.scala similarity index 68% rename from httpclient-backend/src/test/scala/sttp/client/httpclient/HttpClientFutureHttpTest.scala rename to httpclient-backend/src/test/scala/sttp/client3/httpclient/HttpClientFutureHttpTest.scala index b2917197b8..f5ac857055 100644 --- a/httpclient-backend/src/test/scala/sttp/client/httpclient/HttpClientFutureHttpTest.scala +++ b/httpclient-backend/src/test/scala/sttp/client3/httpclient/HttpClientFutureHttpTest.scala @@ -1,7 +1,7 @@ -package sttp.client.httpclient +package sttp.client3.httpclient -import sttp.client.testing.{ConvertToFuture, HttpTest} -import sttp.client.SttpBackend +import sttp.client3.testing.{ConvertToFuture, HttpTest} +import sttp.client3.SttpBackend import scala.concurrent.Future diff --git a/httpclient-backend/src/test/scala/sttp/client/httpclient/HttpClientFutureWebSocketTest.scala b/httpclient-backend/src/test/scala/sttp/client3/httpclient/HttpClientFutureWebSocketTest.scala similarity index 73% rename from httpclient-backend/src/test/scala/sttp/client/httpclient/HttpClientFutureWebSocketTest.scala rename to httpclient-backend/src/test/scala/sttp/client3/httpclient/HttpClientFutureWebSocketTest.scala index fdbe881e45..d0a47bba8c 100644 --- a/httpclient-backend/src/test/scala/sttp/client/httpclient/HttpClientFutureWebSocketTest.scala +++ b/httpclient-backend/src/test/scala/sttp/client3/httpclient/HttpClientFutureWebSocketTest.scala @@ -1,9 +1,9 @@ -package sttp.client.httpclient +package sttp.client3.httpclient import sttp.capabilities.WebSockets -import sttp.client.testing.ConvertToFuture -import sttp.client.testing.websocket.WebSocketTest -import sttp.client.SttpBackend +import sttp.client3.testing.ConvertToFuture +import sttp.client3.testing.websocket.WebSocketTest +import sttp.client3.SttpBackend import sttp.monad.{FutureMonad, MonadError} import scala.concurrent.Future diff --git a/httpclient-backend/src/test/scala/sttp/client/httpclient/HttpClientSyncHttpTest.scala b/httpclient-backend/src/test/scala/sttp/client3/httpclient/HttpClientSyncHttpTest.scala similarity index 63% rename from httpclient-backend/src/test/scala/sttp/client/httpclient/HttpClientSyncHttpTest.scala rename to httpclient-backend/src/test/scala/sttp/client3/httpclient/HttpClientSyncHttpTest.scala index 978d5c99c9..0e143bb829 100644 --- a/httpclient-backend/src/test/scala/sttp/client/httpclient/HttpClientSyncHttpTest.scala +++ b/httpclient-backend/src/test/scala/sttp/client3/httpclient/HttpClientSyncHttpTest.scala @@ -1,7 +1,7 @@ -package sttp.client.httpclient +package sttp.client3.httpclient -import sttp.client.testing.{ConvertToFuture, HttpTest} -import sttp.client.{Identity, SttpBackend} +import sttp.client3.testing.{ConvertToFuture, HttpTest} +import sttp.client3.{Identity, SttpBackend} class HttpClientSyncHttpTest extends HttpTest[Identity] { override val backend: SttpBackend[Identity, Any] = HttpClientSyncBackend() diff --git a/httpclient-backend/zio/src/main/scala/sttp/client/httpclient/zio/HttpClientZioBackend.scala b/httpclient-backend/zio/src/main/scala/sttp/client3/httpclient/zio/HttpClientZioBackend.scala similarity index 92% rename from httpclient-backend/zio/src/main/scala/sttp/client/httpclient/zio/HttpClientZioBackend.scala rename to httpclient-backend/zio/src/main/scala/sttp/client3/httpclient/zio/HttpClientZioBackend.scala index e7ad1ebf6a..d2837a19cb 100644 --- a/httpclient-backend/zio/src/main/scala/sttp/client/httpclient/zio/HttpClientZioBackend.scala +++ b/httpclient-backend/zio/src/main/scala/sttp/client3/httpclient/zio/HttpClientZioBackend.scala @@ -1,4 +1,4 @@ -package sttp.client.httpclient.zio +package sttp.client3.httpclient.zio import java.io.UnsupportedEncodingException import java.net.http.HttpRequest.{BodyPublisher, BodyPublishers} @@ -10,13 +10,13 @@ import _root_.zio.interop.reactivestreams._ import org.reactivestreams.{FlowAdapters, Publisher} import sttp.capabilities.WebSockets import sttp.capabilities.zio.BlockingZioStreams -import sttp.client.httpclient.HttpClientBackend.EncodingHandler -import sttp.client.httpclient.{BodyFromHttpClient, BodyToHttpClient, HttpClientAsyncBackend, HttpClientBackend} -import sttp.client.internal._ -import sttp.client.impl.zio.{RIOMonadAsyncError, ZioSimpleQueue} -import sttp.client.internal.ws.SimpleQueue -import sttp.client.testing.SttpBackendStub -import sttp.client.{FollowRedirectsBackend, SttpBackend, SttpBackendOptions} +import sttp.client3.httpclient.HttpClientBackend.EncodingHandler +import sttp.client3.httpclient.{BodyFromHttpClient, BodyToHttpClient, HttpClientAsyncBackend, HttpClientBackend} +import sttp.client3.internal._ +import sttp.client3.impl.zio.{RIOMonadAsyncError, ZioSimpleQueue} +import sttp.client3.internal.ws.SimpleQueue +import sttp.client3.testing.SttpBackendStub +import sttp.client3.{FollowRedirectsBackend, SttpBackend, SttpBackendOptions} import sttp.monad.MonadError import zio.Chunk.ByteArray import zio._ diff --git a/httpclient-backend/zio/src/main/scala/sttp/client/httpclient/zio/ZioBodyFromHttpClient.scala b/httpclient-backend/zio/src/main/scala/sttp/client3/httpclient/zio/ZioBodyFromHttpClient.scala similarity index 89% rename from httpclient-backend/zio/src/main/scala/sttp/client/httpclient/zio/ZioBodyFromHttpClient.scala rename to httpclient-backend/zio/src/main/scala/sttp/client3/httpclient/zio/ZioBodyFromHttpClient.scala index 4938fff156..7ebf3e7b96 100644 --- a/httpclient-backend/zio/src/main/scala/sttp/client/httpclient/zio/ZioBodyFromHttpClient.scala +++ b/httpclient-backend/zio/src/main/scala/sttp/client3/httpclient/zio/ZioBodyFromHttpClient.scala @@ -1,11 +1,11 @@ -package sttp.client.httpclient.zio +package sttp.client3.httpclient.zio import sttp.capabilities.zio.BlockingZioStreams -import sttp.client.httpclient.BodyFromHttpClient -import sttp.client.impl.zio.{RIOMonadAsyncError, ZioWebSockets} -import sttp.client.internal.{BodyFromResponseAs, SttpFile} -import sttp.client.ws.{GotAWebSocketException, NotAWebSocketException} -import sttp.client.{ResponseMetadata, WebSocketResponseAs} +import sttp.client3.httpclient.BodyFromHttpClient +import sttp.client3.impl.zio.{RIOMonadAsyncError, ZioWebSockets} +import sttp.client3.internal.{BodyFromResponseAs, SttpFile} +import sttp.client3.ws.{GotAWebSocketException, NotAWebSocketException} +import sttp.client3.{ResponseMetadata, WebSocketResponseAs} import sttp.monad.MonadError import sttp.ws.{WebSocket, WebSocketFrame} import zio.blocking.Blocking diff --git a/httpclient-backend/zio/src/main/scala/sttp/client/httpclient/zio/package.scala b/httpclient-backend/zio/src/main/scala/sttp/client3/httpclient/zio/package.scala similarity index 95% rename from httpclient-backend/zio/src/main/scala/sttp/client/httpclient/zio/package.scala rename to httpclient-backend/zio/src/main/scala/sttp/client3/httpclient/zio/package.scala index 58a695eccc..b814d6dff8 100644 --- a/httpclient-backend/zio/src/main/scala/sttp/client/httpclient/zio/package.scala +++ b/httpclient-backend/zio/src/main/scala/sttp/client3/httpclient/zio/package.scala @@ -1,11 +1,11 @@ -package sttp.client.httpclient +package sttp.client3.httpclient -import sttp.client._ +import sttp.client3._ import _root_.zio._ import _root_.zio.blocking.Blocking import sttp.capabilities.zio.BlockingZioStreams import sttp.capabilities.{Effect, WebSockets} -import sttp.client.impl.zio.{ExtendEnv, SttpClientStubbingBase} +import sttp.client3.impl.zio.{ExtendEnv, SttpClientStubbingBase} package object zio { diff --git a/httpclient-backend/zio/src/test/scala/sttp/client/httpclient/zio/HttpClientZioHttpTest.scala b/httpclient-backend/zio/src/test/scala/sttp/client3/httpclient/zio/HttpClientZioHttpTest.scala similarity index 78% rename from httpclient-backend/zio/src/test/scala/sttp/client/httpclient/zio/HttpClientZioHttpTest.scala rename to httpclient-backend/zio/src/test/scala/sttp/client3/httpclient/zio/HttpClientZioHttpTest.scala index 09108355c0..d2e4bf140a 100644 --- a/httpclient-backend/zio/src/test/scala/sttp/client/httpclient/zio/HttpClientZioHttpTest.scala +++ b/httpclient-backend/zio/src/test/scala/sttp/client3/httpclient/zio/HttpClientZioHttpTest.scala @@ -1,8 +1,8 @@ -package sttp.client.httpclient.zio +package sttp.client3.httpclient.zio -import sttp.client._ -import sttp.client.impl.zio.ZioTestBase -import sttp.client.testing.{ConvertToFuture, HttpTest} +import sttp.client3._ +import sttp.client3.impl.zio.ZioTestBase +import sttp.client3.testing.{ConvertToFuture, HttpTest} class HttpClientZioHttpTest extends HttpTest[BlockingTask] with ZioTestBase { override val backend: SttpBackend[BlockingTask, Any] = diff --git a/httpclient-backend/zio/src/test/scala/sttp/client/httpclient/zio/HttpClientZioStreamingTest.scala b/httpclient-backend/zio/src/test/scala/sttp/client3/httpclient/zio/HttpClientZioStreamingTest.scala similarity index 79% rename from httpclient-backend/zio/src/test/scala/sttp/client/httpclient/zio/HttpClientZioStreamingTest.scala rename to httpclient-backend/zio/src/test/scala/sttp/client3/httpclient/zio/HttpClientZioStreamingTest.scala index 0c39c844e9..901f505c2b 100644 --- a/httpclient-backend/zio/src/test/scala/sttp/client/httpclient/zio/HttpClientZioStreamingTest.scala +++ b/httpclient-backend/zio/src/test/scala/sttp/client3/httpclient/zio/HttpClientZioStreamingTest.scala @@ -1,11 +1,11 @@ -package sttp.client.httpclient.zio +package sttp.client3.httpclient.zio import sttp.capabilities.zio.BlockingZioStreams -import sttp.client.SttpBackend -import sttp.client.impl.zio.ZioTestBase -import sttp.client.internal._ -import sttp.client.testing.ConvertToFuture -import sttp.client.testing.streaming.StreamingTest +import sttp.client3.SttpBackend +import sttp.client3.impl.zio.ZioTestBase +import sttp.client3.internal._ +import sttp.client3.testing.ConvertToFuture +import sttp.client3.testing.streaming.StreamingTest import zio._ import zio.blocking.Blocking import zio.stream._ diff --git a/httpclient-backend/zio/src/test/scala/sttp/client/httpclient/zio/HttpClientZioWebSocketTest.scala b/httpclient-backend/zio/src/test/scala/sttp/client3/httpclient/zio/HttpClientZioWebSocketTest.scala similarity index 81% rename from httpclient-backend/zio/src/test/scala/sttp/client/httpclient/zio/HttpClientZioWebSocketTest.scala rename to httpclient-backend/zio/src/test/scala/sttp/client3/httpclient/zio/HttpClientZioWebSocketTest.scala index 8da0d977c7..48eeda97a4 100644 --- a/httpclient-backend/zio/src/test/scala/sttp/client/httpclient/zio/HttpClientZioWebSocketTest.scala +++ b/httpclient-backend/zio/src/test/scala/sttp/client3/httpclient/zio/HttpClientZioWebSocketTest.scala @@ -1,13 +1,13 @@ -package sttp.client.httpclient.zio +package sttp.client3.httpclient.zio import sttp.capabilities.WebSockets import sttp.capabilities.zio.BlockingZioStreams -import sttp.client._ -import sttp.client.impl.zio.ZioWebSockets.PipeR -import sttp.client.impl.zio.{RIOMonadAsyncError, ZioTestBase, ZioWebSockets} +import sttp.client3._ +import sttp.client3.impl.zio.ZioWebSockets.PipeR +import sttp.client3.impl.zio.{RIOMonadAsyncError, ZioTestBase, ZioWebSockets} import sttp.monad.MonadError -import sttp.client.testing.ConvertToFuture -import sttp.client.testing.websocket.{WebSocketStreamingTest, WebSocketTest} +import sttp.client3.testing.ConvertToFuture +import sttp.client3.testing.websocket.{WebSocketStreamingTest, WebSocketTest} import sttp.ws.WebSocketFrame import zio.blocking.Blocking import zio.stream._ diff --git a/httpclient-backend/zio/src/test/scala/sttp/client/httpclient/zio/SttpBackendStubZioTests.scala b/httpclient-backend/zio/src/test/scala/sttp/client3/httpclient/zio/SttpBackendStubZioTests.scala similarity index 93% rename from httpclient-backend/zio/src/test/scala/sttp/client/httpclient/zio/SttpBackendStubZioTests.scala rename to httpclient-backend/zio/src/test/scala/sttp/client3/httpclient/zio/SttpBackendStubZioTests.scala index c35fdc90f6..eb962ff1ab 100644 --- a/httpclient-backend/zio/src/test/scala/sttp/client/httpclient/zio/SttpBackendStubZioTests.scala +++ b/httpclient-backend/zio/src/test/scala/sttp/client3/httpclient/zio/SttpBackendStubZioTests.scala @@ -1,11 +1,11 @@ -package sttp.client.httpclient.zio +package sttp.client3.httpclient.zio import org.scalatest.concurrent.ScalaFutures import org.scalatest.flatspec.AnyFlatSpec import org.scalatest.matchers.should.Matchers -import sttp.client._ -import sttp.client.impl.zio._ -import sttp.client.testing.SttpBackendStub +import sttp.client3._ +import sttp.client3.impl.zio._ +import sttp.client3.testing.SttpBackendStub import sttp.model.Method import zio.Task import zio.stream.ZStream diff --git a/implementations/cats/src/main/scala/sttp/client/impl/cats/CatsMonadAsyncError.scala b/implementations/cats/src/main/scala/sttp/client3/impl/cats/CatsMonadAsyncError.scala similarity index 96% rename from implementations/cats/src/main/scala/sttp/client/impl/cats/CatsMonadAsyncError.scala rename to implementations/cats/src/main/scala/sttp/client3/impl/cats/CatsMonadAsyncError.scala index 2e25de237c..873111200b 100644 --- a/implementations/cats/src/main/scala/sttp/client/impl/cats/CatsMonadAsyncError.scala +++ b/implementations/cats/src/main/scala/sttp/client3/impl/cats/CatsMonadAsyncError.scala @@ -1,4 +1,4 @@ -package sttp.client.impl.cats +package sttp.client3.impl.cats import cats.effect.Concurrent import sttp.monad.{Canceler, MonadAsyncError} diff --git a/implementations/cats/src/main/scala/sttp/client/impl/cats/implicits.scala b/implementations/cats/src/main/scala/sttp/client3/impl/cats/implicits.scala similarity index 90% rename from implementations/cats/src/main/scala/sttp/client/impl/cats/implicits.scala rename to implementations/cats/src/main/scala/sttp/client3/impl/cats/implicits.scala index 0593d87ec9..229a900867 100644 --- a/implementations/cats/src/main/scala/sttp/client/impl/cats/implicits.scala +++ b/implementations/cats/src/main/scala/sttp/client3/impl/cats/implicits.scala @@ -1,10 +1,10 @@ -package sttp.client.impl.cats +package sttp.client3.impl.cats import cats.effect.Concurrent import cats.~> import sttp.capabilities.Effect -import sttp.client.monad.{FunctionK, MapEffect} -import sttp.client.{Identity, Request, Response, SttpBackend} +import sttp.client3.monad.{FunctionK, MapEffect} +import sttp.client3.{Identity, Request, Response, SttpBackend} import sttp.monad.{MonadAsyncError, MonadError} object implicits extends CatsImplicits diff --git a/implementations/cats/src/test/scala/sttp/client/impl/cats/CatsTestBase.scala b/implementations/cats/src/test/scala/sttp/client3/impl/cats/CatsTestBase.scala similarity index 88% rename from implementations/cats/src/test/scala/sttp/client/impl/cats/CatsTestBase.scala rename to implementations/cats/src/test/scala/sttp/client3/impl/cats/CatsTestBase.scala index 37510c5705..2b46498ff1 100644 --- a/implementations/cats/src/test/scala/sttp/client/impl/cats/CatsTestBase.scala +++ b/implementations/cats/src/test/scala/sttp/client3/impl/cats/CatsTestBase.scala @@ -1,7 +1,7 @@ -package sttp.client.impl.cats +package sttp.client3.impl.cats import cats.effect.{Blocker, ContextShift, IO, Timer} -import sttp.client.testing.ConvertToFuture +import sttp.client3.testing.ConvertToFuture import scala.concurrent.ExecutionContext import sttp.monad.MonadError diff --git a/implementations/cats/src/test/scala/sttp/client/impl/cats/package.scala b/implementations/cats/src/test/scala/sttp/client3/impl/cats/package.scala similarity index 77% rename from implementations/cats/src/test/scala/sttp/client/impl/cats/package.scala rename to implementations/cats/src/test/scala/sttp/client3/impl/cats/package.scala index 3877b24eff..70b8cf256e 100644 --- a/implementations/cats/src/test/scala/sttp/client/impl/cats/package.scala +++ b/implementations/cats/src/test/scala/sttp/client3/impl/cats/package.scala @@ -1,7 +1,7 @@ -package sttp.client.impl +package sttp.client3.impl import _root_.cats.effect.IO -import sttp.client.testing.ConvertToFuture +import sttp.client3.testing.ConvertToFuture import scala.concurrent.Future diff --git a/implementations/fs2/src/main/scala/sttp/client/impl/fs2/Fs2SimpleQueue.scala b/implementations/fs2/src/main/scala/sttp/client3/impl/fs2/Fs2SimpleQueue.scala similarity index 87% rename from implementations/fs2/src/main/scala/sttp/client/impl/fs2/Fs2SimpleQueue.scala rename to implementations/fs2/src/main/scala/sttp/client3/impl/fs2/Fs2SimpleQueue.scala index c324d64976..909142f1d8 100644 --- a/implementations/fs2/src/main/scala/sttp/client/impl/fs2/Fs2SimpleQueue.scala +++ b/implementations/fs2/src/main/scala/sttp/client3/impl/fs2/Fs2SimpleQueue.scala @@ -1,8 +1,8 @@ -package sttp.client.impl.fs2 +package sttp.client3.impl.fs2 import cats.effect.{Effect, IO} import fs2.concurrent.InspectableQueue -import sttp.client.internal.ws.SimpleQueue +import sttp.client3.internal.ws.SimpleQueue import sttp.ws.WebSocketBufferFull class Fs2SimpleQueue[F[_], A](queue: InspectableQueue[F, A], capacity: Option[Int])(implicit F: Effect[F]) diff --git a/implementations/fs2/src/main/scala/sttp/client/impl/fs2/Fs2WebSockets.scala b/implementations/fs2/src/main/scala/sttp/client3/impl/fs2/Fs2WebSockets.scala similarity index 98% rename from implementations/fs2/src/main/scala/sttp/client/impl/fs2/Fs2WebSockets.scala rename to implementations/fs2/src/main/scala/sttp/client3/impl/fs2/Fs2WebSockets.scala index bf1e4e6b34..a318115123 100644 --- a/implementations/fs2/src/main/scala/sttp/client/impl/fs2/Fs2WebSockets.scala +++ b/implementations/fs2/src/main/scala/sttp/client3/impl/fs2/Fs2WebSockets.scala @@ -1,4 +1,4 @@ -package sttp.client.impl.fs2 +package sttp.client3.impl.fs2 import cats.effect.ConcurrentEffect import cats.effect.concurrent.Ref diff --git a/implementations/fs2/src/test/scala/sttp/client/impl/fs2/Fs2StreamingTest.scala b/implementations/fs2/src/test/scala/sttp/client3/impl/fs2/Fs2StreamingTest.scala similarity index 82% rename from implementations/fs2/src/test/scala/sttp/client/impl/fs2/Fs2StreamingTest.scala rename to implementations/fs2/src/test/scala/sttp/client3/impl/fs2/Fs2StreamingTest.scala index 5a59c0cb31..305fa01b14 100644 --- a/implementations/fs2/src/test/scala/sttp/client/impl/fs2/Fs2StreamingTest.scala +++ b/implementations/fs2/src/test/scala/sttp/client3/impl/fs2/Fs2StreamingTest.scala @@ -1,11 +1,11 @@ -package sttp.client.impl.fs2 +package sttp.client3.impl.fs2 import cats.effect.IO import cats.instances.string._ import fs2.{Chunk, Stream} import sttp.capabilities.fs2.Fs2Streams -import sttp.client.impl.cats.CatsTestBase -import sttp.client.testing.streaming.StreamingTest +import sttp.client3.impl.cats.CatsTestBase +import sttp.client3.testing.streaming.StreamingTest trait Fs2StreamingTest extends StreamingTest[IO, Fs2Streams[IO]] with CatsTestBase { override val streams: Fs2Streams[IO] = new Fs2Streams[IO] {} diff --git a/implementations/monix/src/main/scala/sttp/client/impl/monix/MonixSimpleQueue.scala b/implementations/monix/src/main/scala/sttp/client3/impl/monix/MonixSimpleQueue.scala similarity index 88% rename from implementations/monix/src/main/scala/sttp/client/impl/monix/MonixSimpleQueue.scala rename to implementations/monix/src/main/scala/sttp/client3/impl/monix/MonixSimpleQueue.scala index 9517947e0d..60e65185ab 100644 --- a/implementations/monix/src/main/scala/sttp/client/impl/monix/MonixSimpleQueue.scala +++ b/implementations/monix/src/main/scala/sttp/client3/impl/monix/MonixSimpleQueue.scala @@ -1,8 +1,8 @@ -package sttp.client.impl.monix +package sttp.client3.impl.monix import monix.eval.Task import monix.execution.{Scheduler, AsyncQueue => MAsyncQueue} -import sttp.client.internal.ws.SimpleQueue +import sttp.client3.internal.ws.SimpleQueue import sttp.ws.WebSocketBufferFull class MonixSimpleQueue[A](bufferCapacity: Option[Int])(implicit s: Scheduler) extends SimpleQueue[Task, A] { diff --git a/implementations/monix/src/main/scala/sttp/client/impl/monix/MonixWebSockets.scala b/implementations/monix/src/main/scala/sttp/client3/impl/monix/MonixWebSockets.scala similarity index 98% rename from implementations/monix/src/main/scala/sttp/client/impl/monix/MonixWebSockets.scala rename to implementations/monix/src/main/scala/sttp/client3/impl/monix/MonixWebSockets.scala index 788dab3d71..888cef254f 100644 --- a/implementations/monix/src/main/scala/sttp/client/impl/monix/MonixWebSockets.scala +++ b/implementations/monix/src/main/scala/sttp/client3/impl/monix/MonixWebSockets.scala @@ -1,4 +1,4 @@ -package sttp.client.impl.monix +package sttp.client3.impl.monix import monix.eval.Task import monix.execution.cancelables.BooleanCancelable diff --git a/implementations/monix/src/main/scala/sttp/client/impl/monix/TaskMonadAsyncError.scala b/implementations/monix/src/main/scala/sttp/client3/impl/monix/TaskMonadAsyncError.scala similarity index 97% rename from implementations/monix/src/main/scala/sttp/client/impl/monix/TaskMonadAsyncError.scala rename to implementations/monix/src/main/scala/sttp/client3/impl/monix/TaskMonadAsyncError.scala index f34570f65c..27b04ec13f 100644 --- a/implementations/monix/src/main/scala/sttp/client/impl/monix/TaskMonadAsyncError.scala +++ b/implementations/monix/src/main/scala/sttp/client3/impl/monix/TaskMonadAsyncError.scala @@ -1,4 +1,4 @@ -package sttp.client.impl.monix +package sttp.client3.impl.monix import monix.eval.Task import sttp.monad.{Canceler, MonadAsyncError} diff --git a/implementations/monix/src/main/scalajs/sttp/client/impl/monix/FetchMonixBackend.scala b/implementations/monix/src/main/scalajs/sttp/client3/impl/monix/FetchMonixBackend.scala similarity index 95% rename from implementations/monix/src/main/scalajs/sttp/client/impl/monix/FetchMonixBackend.scala rename to implementations/monix/src/main/scalajs/sttp/client3/impl/monix/FetchMonixBackend.scala index 8523e4f9a2..f23c43788c 100644 --- a/implementations/monix/src/main/scalajs/sttp/client/impl/monix/FetchMonixBackend.scala +++ b/implementations/monix/src/main/scalajs/sttp/client3/impl/monix/FetchMonixBackend.scala @@ -1,17 +1,17 @@ -package sttp.client.impl.monix +package sttp.client3.impl.monix import java.nio.ByteBuffer import monix.eval.Task import monix.reactive.Observable import org.scalajs.dom.experimental.{BodyInit, Response => FetchResponse} -import sttp.client.{AbstractFetchBackend, FetchOptions, SttpBackend} +import sttp.client3.{AbstractFetchBackend, FetchOptions, SttpBackend} import scala.scalajs.js import scala.scalajs.js.Promise import scala.scalajs.js.typedarray.{Int8Array, _} import org.scalajs.dom.experimental.{Request => FetchRequest} -import sttp.client.testing.SttpBackendStub +import sttp.client3.testing.SttpBackendStub import sttp.capabilities.monix.MonixStreams /** diff --git a/implementations/monix/src/test/scala/sttp/client/impl/monix/MonixStreamingTest.scala b/implementations/monix/src/test/scala/sttp/client3/impl/monix/MonixStreamingTest.scala similarity index 84% rename from implementations/monix/src/test/scala/sttp/client/impl/monix/MonixStreamingTest.scala rename to implementations/monix/src/test/scala/sttp/client3/impl/monix/MonixStreamingTest.scala index 5ba0af9bda..17ebd5663c 100644 --- a/implementations/monix/src/test/scala/sttp/client/impl/monix/MonixStreamingTest.scala +++ b/implementations/monix/src/test/scala/sttp/client3/impl/monix/MonixStreamingTest.scala @@ -1,12 +1,12 @@ -package sttp.client.impl.monix +package sttp.client3.impl.monix import java.nio.ByteBuffer import monix.eval.Task import monix.reactive.Observable import sttp.capabilities.monix.MonixStreams -import sttp.client.testing.ConvertToFuture -import sttp.client.testing.streaming.StreamingTest +import sttp.client3.testing.ConvertToFuture +import sttp.client3.testing.streaming.StreamingTest abstract class MonixStreamingTest extends StreamingTest[Task, MonixStreams] { override val streams: MonixStreams = MonixStreams diff --git a/implementations/monix/src/test/scala/sttp/client/impl/monix/package.scala b/implementations/monix/src/test/scala/sttp/client3/impl/monix/package.scala similarity index 81% rename from implementations/monix/src/test/scala/sttp/client/impl/monix/package.scala rename to implementations/monix/src/test/scala/sttp/client3/impl/monix/package.scala index f8eb6b54af..579c7d6a97 100644 --- a/implementations/monix/src/test/scala/sttp/client/impl/monix/package.scala +++ b/implementations/monix/src/test/scala/sttp/client3/impl/monix/package.scala @@ -1,9 +1,9 @@ -package sttp.client.impl +package sttp.client3.impl import scala.concurrent.Future import _root_.monix.eval.Task -import sttp.client.testing.ConvertToFuture +import sttp.client3.testing.ConvertToFuture package object monix { diff --git a/implementations/monix/src/test/scalajs/client/impl/monix/FetchMonixHttpTest.scala b/implementations/monix/src/test/scalajs/client3/impl/monix/FetchMonixHttpTest.scala similarity index 74% rename from implementations/monix/src/test/scalajs/client/impl/monix/FetchMonixHttpTest.scala rename to implementations/monix/src/test/scalajs/client3/impl/monix/FetchMonixHttpTest.scala index 80866eed44..0af38eca3b 100644 --- a/implementations/monix/src/test/scalajs/client/impl/monix/FetchMonixHttpTest.scala +++ b/implementations/monix/src/test/scalajs/client3/impl/monix/FetchMonixHttpTest.scala @@ -1,8 +1,8 @@ -package sttp.client.impl.monix +package sttp.client3.impl.monix import monix.eval.Task -import sttp.client.SttpBackend -import sttp.client.testing.{AbstractFetchHttpTest, ConvertToFuture} +import sttp.client3.SttpBackend +import sttp.client3.testing.{AbstractFetchHttpTest, ConvertToFuture} import sttp.capabilities.monix.MonixStreams class FetchMonixHttpTest extends AbstractFetchHttpTest[Task, MonixStreams] { diff --git a/implementations/monix/src/test/scalajs/client/impl/monix/FetchMonixStreamingTest.scala b/implementations/monix/src/test/scalajs/client3/impl/monix/FetchMonixStreamingTest.scala similarity index 81% rename from implementations/monix/src/test/scalajs/client/impl/monix/FetchMonixStreamingTest.scala rename to implementations/monix/src/test/scalajs/client3/impl/monix/FetchMonixStreamingTest.scala index d0328df64a..c04a7a368b 100644 --- a/implementations/monix/src/test/scalajs/client/impl/monix/FetchMonixStreamingTest.scala +++ b/implementations/monix/src/test/scalajs/client3/impl/monix/FetchMonixStreamingTest.scala @@ -1,7 +1,7 @@ -package sttp.client.impl.monix +package sttp.client3.impl.monix import monix.eval.Task -import sttp.client.SttpBackend +import sttp.client3.SttpBackend import sttp.capabilities.monix.MonixStreams class FetchMonixStreamingTest extends MonixStreamingTest { diff --git a/implementations/scalaz/src/main/scala/sttp/client/impl/scalaz/TaskMonadAsyncError.scala b/implementations/scalaz/src/main/scala/sttp/client3/impl/scalaz/TaskMonadAsyncError.scala similarity index 96% rename from implementations/scalaz/src/main/scala/sttp/client/impl/scalaz/TaskMonadAsyncError.scala rename to implementations/scalaz/src/main/scala/sttp/client3/impl/scalaz/TaskMonadAsyncError.scala index a3aad512b6..c4927fe05e 100644 --- a/implementations/scalaz/src/main/scala/sttp/client/impl/scalaz/TaskMonadAsyncError.scala +++ b/implementations/scalaz/src/main/scala/sttp/client3/impl/scalaz/TaskMonadAsyncError.scala @@ -1,4 +1,4 @@ -package sttp.client.impl.scalaz +package sttp.client3.impl.scalaz import scalaz.concurrent.Task import scalaz.{-\/, \/-} diff --git a/implementations/scalaz/src/main/scala/sttp/client/impl/scalaz/implicits.scala b/implementations/scalaz/src/main/scala/sttp/client3/impl/scalaz/implicits.scala similarity index 89% rename from implementations/scalaz/src/main/scala/sttp/client/impl/scalaz/implicits.scala rename to implementations/scalaz/src/main/scala/sttp/client3/impl/scalaz/implicits.scala index fd9dbd5fe8..a1d0c46cdf 100644 --- a/implementations/scalaz/src/main/scala/sttp/client/impl/scalaz/implicits.scala +++ b/implementations/scalaz/src/main/scala/sttp/client3/impl/scalaz/implicits.scala @@ -1,9 +1,9 @@ -package sttp.client.impl.scalaz +package sttp.client3.impl.scalaz import scalaz.~> import sttp.capabilities.Effect -import sttp.client.monad.{FunctionK, MapEffect} -import sttp.client.{Identity, Request, Response, SttpBackend} +import sttp.client3.monad.{FunctionK, MapEffect} +import sttp.client3.{Identity, Request, Response, SttpBackend} import sttp.monad.MonadError object implicits extends ScalazImplicits diff --git a/implementations/scalaz/src/test/scala/sttp/client/impl/scalaz/package.scala b/implementations/scalaz/src/test/scala/sttp/client3/impl/scalaz/package.scala similarity index 88% rename from implementations/scalaz/src/test/scala/sttp/client/impl/scalaz/package.scala rename to implementations/scalaz/src/test/scala/sttp/client3/impl/scalaz/package.scala index b1bc58b2be..92b891b1d6 100644 --- a/implementations/scalaz/src/test/scala/sttp/client/impl/scalaz/package.scala +++ b/implementations/scalaz/src/test/scala/sttp/client3/impl/scalaz/package.scala @@ -1,6 +1,6 @@ -package sttp.client.impl +package sttp.client3.impl -import sttp.client.testing.ConvertToFuture +import sttp.client3.testing.ConvertToFuture import _root_.scalaz.concurrent.Task import _root_.scalaz.{-\/, \/-} diff --git a/implementations/zio/src/main/scala/sttp/client/impl/zio/RIOMonadAsyncError.scala b/implementations/zio/src/main/scala/sttp/client3/impl/zio/RIOMonadAsyncError.scala similarity index 97% rename from implementations/zio/src/main/scala/sttp/client/impl/zio/RIOMonadAsyncError.scala rename to implementations/zio/src/main/scala/sttp/client3/impl/zio/RIOMonadAsyncError.scala index 3a0c146749..c84a7a571f 100644 --- a/implementations/zio/src/main/scala/sttp/client/impl/zio/RIOMonadAsyncError.scala +++ b/implementations/zio/src/main/scala/sttp/client3/impl/zio/RIOMonadAsyncError.scala @@ -1,4 +1,4 @@ -package sttp.client.impl.zio +package sttp.client3.impl.zio import sttp.monad.{Canceler, MonadAsyncError} import zio.{RIO, UIO, ZIO} diff --git a/implementations/zio/src/main/scala/sttp/client/impl/zio/SttpClientStubbingBase.scala b/implementations/zio/src/main/scala/sttp/client3/impl/zio/SttpClientStubbingBase.scala similarity index 96% rename from implementations/zio/src/main/scala/sttp/client/impl/zio/SttpClientStubbingBase.scala rename to implementations/zio/src/main/scala/sttp/client3/impl/zio/SttpClientStubbingBase.scala index cbe9155520..c218bd9736 100644 --- a/implementations/zio/src/main/scala/sttp/client/impl/zio/SttpClientStubbingBase.scala +++ b/implementations/zio/src/main/scala/sttp/client3/impl/zio/SttpClientStubbingBase.scala @@ -1,8 +1,8 @@ -package sttp.client.impl.zio +package sttp.client3.impl.zio import sttp.capabilities.Effect -import sttp.client.testing.SttpBackendStub -import sttp.client.{Request, Response, SttpBackend} +import sttp.client3.testing.SttpBackendStub +import sttp.client3.{Request, Response, SttpBackend} import sttp.model.StatusCode import sttp.monad.MonadError import zio.{Has, RIO, Ref, Tag, UIO, URIO, ZLayer} diff --git a/implementations/zio/src/main/scala/sttp/client/impl/zio/ZioSimpleQueue.scala b/implementations/zio/src/main/scala/sttp/client3/impl/zio/ZioSimpleQueue.scala similarity index 83% rename from implementations/zio/src/main/scala/sttp/client/impl/zio/ZioSimpleQueue.scala rename to implementations/zio/src/main/scala/sttp/client3/impl/zio/ZioSimpleQueue.scala index a6c7f02300..1e2424fea1 100644 --- a/implementations/zio/src/main/scala/sttp/client/impl/zio/ZioSimpleQueue.scala +++ b/implementations/zio/src/main/scala/sttp/client3/impl/zio/ZioSimpleQueue.scala @@ -1,6 +1,6 @@ -package sttp.client.impl.zio +package sttp.client3.impl.zio -import sttp.client.internal.ws.SimpleQueue +import sttp.client3.internal.ws.SimpleQueue import sttp.ws.WebSocketBufferFull import zio.{Queue, RIO, Runtime} diff --git a/implementations/zio/src/main/scala/sttp/client/impl/zio/ZioWebSockets.scala b/implementations/zio/src/main/scala/sttp/client3/impl/zio/ZioWebSockets.scala similarity index 92% rename from implementations/zio/src/main/scala/sttp/client/impl/zio/ZioWebSockets.scala rename to implementations/zio/src/main/scala/sttp/client3/impl/zio/ZioWebSockets.scala index 6b8f894674..e06a3a33ee 100644 --- a/implementations/zio/src/main/scala/sttp/client/impl/zio/ZioWebSockets.scala +++ b/implementations/zio/src/main/scala/sttp/client3/impl/zio/ZioWebSockets.scala @@ -1,4 +1,4 @@ -package sttp.client.impl.zio +package sttp.client3.impl.zio import sttp.ws.{WebSocket, WebSocketFrame} import zio.stream.{Stream, Transducer, ZStream} @@ -46,8 +46,8 @@ object ZioWebSockets { Seq(tf) } } - .aggregate(Transducer.collectAllWhile { - case WebSocketFrame.Text(_, finalFragment, _) => !finalFragment + .aggregate(Transducer.collectAllWhile { case WebSocketFrame.Text(_, finalFragment, _) => + !finalFragment }) .map(_.map(_.payload).mkString) } diff --git a/implementations/zio/src/main/scala/sttp/client/impl/zio/package.scala b/implementations/zio/src/main/scala/sttp/client3/impl/zio/package.scala similarity index 90% rename from implementations/zio/src/main/scala/sttp/client/impl/zio/package.scala rename to implementations/zio/src/main/scala/sttp/client3/impl/zio/package.scala index 2eb794e45f..77a6c3cb19 100644 --- a/implementations/zio/src/main/scala/sttp/client/impl/zio/package.scala +++ b/implementations/zio/src/main/scala/sttp/client3/impl/zio/package.scala @@ -1,8 +1,8 @@ -package sttp.client.impl +package sttp.client3.impl import sttp.capabilities.Effect -import sttp.client.monad.{FunctionK, MapEffect} -import sttp.client.{Identity, Request, Response, SttpBackend} +import sttp.client3.monad.{FunctionK, MapEffect} +import sttp.client3.{Identity, Request, Response, SttpBackend} import sttp.monad.MonadError import _root_.zio.{RIO, ZIO} diff --git a/implementations/zio/src/test/scala/sttp/client/impl/zio/ZioTestBase.scala b/implementations/zio/src/test/scala/sttp/client3/impl/zio/ZioTestBase.scala similarity index 94% rename from implementations/zio/src/test/scala/sttp/client/impl/zio/ZioTestBase.scala rename to implementations/zio/src/test/scala/sttp/client3/impl/zio/ZioTestBase.scala index ee778632b8..785b30f1f1 100644 --- a/implementations/zio/src/test/scala/sttp/client/impl/zio/ZioTestBase.scala +++ b/implementations/zio/src/test/scala/sttp/client3/impl/zio/ZioTestBase.scala @@ -1,6 +1,6 @@ -package sttp.client.impl.zio +package sttp.client3.impl.zio -import sttp.client.testing.ConvertToFuture +import sttp.client3.testing.ConvertToFuture import zio.{Exit, Runtime, Task, ZEnv, ZIO} import zio.blocking.Blocking diff --git a/json/circe/src/main/scala/sttp/client/circe/SttpCirceApi.scala b/json/circe/src/main/scala/sttp/client3/circe/SttpCirceApi.scala similarity index 95% rename from json/circe/src/main/scala/sttp/client/circe/SttpCirceApi.scala rename to json/circe/src/main/scala/sttp/client3/circe/SttpCirceApi.scala index 20de1079bb..6bbcbd9486 100644 --- a/json/circe/src/main/scala/sttp/client/circe/SttpCirceApi.scala +++ b/json/circe/src/main/scala/sttp/client3/circe/SttpCirceApi.scala @@ -1,11 +1,11 @@ -package sttp.client.circe +package sttp.client3.circe -import sttp.client._ +import sttp.client3._ import io.circe.parser.decode import io.circe.{Decoder, Encoder, Printer} -import sttp.client.internal.Utf8 +import sttp.client3.internal.Utf8 import sttp.model.MediaType -import sttp.client.json._ +import sttp.client3.json._ trait SttpCirceApi { diff --git a/json/circe/src/main/scala/sttp/client/circe/package.scala b/json/circe/src/main/scala/sttp/client3/circe/package.scala similarity index 67% rename from json/circe/src/main/scala/sttp/client/circe/package.scala rename to json/circe/src/main/scala/sttp/client3/circe/package.scala index bba7d2a8b1..418f40eefc 100644 --- a/json/circe/src/main/scala/sttp/client/circe/package.scala +++ b/json/circe/src/main/scala/sttp/client3/circe/package.scala @@ -1,3 +1,3 @@ -package sttp.client +package sttp.client3 package object circe extends SttpCirceApi diff --git a/json/circe/src/test/scala/sttp/client/circe/CirceTests.scala b/json/circe/src/test/scala/sttp/client3/circe/CirceTests.scala similarity index 98% rename from json/circe/src/test/scala/sttp/client/circe/CirceTests.scala rename to json/circe/src/test/scala/sttp/client3/circe/CirceTests.scala index 2521aefb38..0b82947ede 100644 --- a/json/circe/src/test/scala/sttp/client/circe/CirceTests.scala +++ b/json/circe/src/test/scala/sttp/client3/circe/CirceTests.scala @@ -1,9 +1,9 @@ -package sttp.client.circe +package sttp.client3.circe import io.circe._ import org.scalatest._ -import sttp.client.internal._ -import sttp.client._ +import sttp.client3.internal._ +import sttp.client3._ import sttp.model._ import org.scalatest.flatspec.AnyFlatSpec diff --git a/json/circe/src/test/scala/sttp/client/circe/SttpBackendStubCirceTests.scala b/json/circe/src/test/scala/sttp/client3/circe/SttpBackendStubCirceTests.scala similarity index 86% rename from json/circe/src/test/scala/sttp/client/circe/SttpBackendStubCirceTests.scala rename to json/circe/src/test/scala/sttp/client3/circe/SttpBackendStubCirceTests.scala index 1697dd9090..9f9d8c4694 100644 --- a/json/circe/src/test/scala/sttp/client/circe/SttpBackendStubCirceTests.scala +++ b/json/circe/src/test/scala/sttp/client3/circe/SttpBackendStubCirceTests.scala @@ -1,8 +1,8 @@ -package sttp.client.circe +package sttp.client3.circe import org.scalatest.concurrent.ScalaFutures -import sttp.client._ -import sttp.client.testing.SttpBackendStub +import sttp.client3._ +import sttp.client3.testing.SttpBackendStub import io.circe.generic.auto._ import org.scalatest.flatspec.AnyFlatSpec import org.scalatest.matchers.should.Matchers diff --git a/json/common/src/main/scala/sttp/client/IsOption.scala b/json/common/src/main/scala/sttp/client3/IsOption.scala similarity index 96% rename from json/common/src/main/scala/sttp/client/IsOption.scala rename to json/common/src/main/scala/sttp/client3/IsOption.scala index 64ec9e93e0..8a3377b21a 100644 --- a/json/common/src/main/scala/sttp/client/IsOption.scala +++ b/json/common/src/main/scala/sttp/client3/IsOption.scala @@ -1,4 +1,4 @@ -package sttp.client +package sttp.client3 trait IsOption[-T] { def isOption: Boolean diff --git a/json/common/src/main/scala/sttp/client/JsonInput.scala b/json/common/src/main/scala/sttp/client3/JsonInput.scala similarity index 89% rename from json/common/src/main/scala/sttp/client/JsonInput.scala rename to json/common/src/main/scala/sttp/client3/JsonInput.scala index fbf85a4b7b..5c1be0f67b 100644 --- a/json/common/src/main/scala/sttp/client/JsonInput.scala +++ b/json/common/src/main/scala/sttp/client3/JsonInput.scala @@ -1,4 +1,4 @@ -package sttp.client +package sttp.client3 protected[sttp] object JsonInput { def sanitize[T: IsOption]: String => String = { s => diff --git a/json/common/src/main/scala/sttp/client/json/package.scala b/json/common/src/main/scala/sttp/client3/json/package.scala similarity index 93% rename from json/common/src/main/scala/sttp/client/json/package.scala rename to json/common/src/main/scala/sttp/client3/json/package.scala index 4dfbe3e043..5ec8f2f443 100644 --- a/json/common/src/main/scala/sttp/client/json/package.scala +++ b/json/common/src/main/scala/sttp/client3/json/package.scala @@ -1,4 +1,4 @@ -package sttp.client +package sttp.client3 package object json { implicit class RichResponseAs[T, R](ra: ResponseAs[T, R]) { diff --git a/json/json4s/src/main/scala/sttp/client/json4s/SttpJson4sApi.scala b/json/json4s/src/main/scala/sttp/client3/json4s/SttpJson4sApi.scala similarity index 95% rename from json/json4s/src/main/scala/sttp/client/json4s/SttpJson4sApi.scala rename to json/json4s/src/main/scala/sttp/client3/json4s/SttpJson4sApi.scala index 84b0e0f034..305c6cc42b 100644 --- a/json/json4s/src/main/scala/sttp/client/json4s/SttpJson4sApi.scala +++ b/json/json4s/src/main/scala/sttp/client3/json4s/SttpJson4sApi.scala @@ -1,9 +1,9 @@ -package sttp.client.json4s +package sttp.client3.json4s import org.json4s.{Formats, Serialization} -import sttp.client.{ResponseAs, _} -import sttp.client.internal.Utf8 -import sttp.client.json._ +import sttp.client3.{ResponseAs, _} +import sttp.client3.internal.Utf8 +import sttp.client3.json._ import sttp.model._ trait SttpJson4sApi { diff --git a/json/json4s/src/main/scala/sttp/client/json4s/package.scala b/json/json4s/src/main/scala/sttp/client3/json4s/package.scala similarity index 68% rename from json/json4s/src/main/scala/sttp/client/json4s/package.scala rename to json/json4s/src/main/scala/sttp/client3/json4s/package.scala index 4e34fc504e..f0b29248b3 100644 --- a/json/json4s/src/main/scala/sttp/client/json4s/package.scala +++ b/json/json4s/src/main/scala/sttp/client3/json4s/package.scala @@ -1,3 +1,3 @@ -package sttp.client +package sttp.client3 package object json4s extends SttpJson4sApi diff --git a/json/json4s/src/test/scala/sttp/client/Json4sTests.scala b/json/json4s/src/test/scala/sttp/client3/Json4sTests.scala similarity index 98% rename from json/json4s/src/test/scala/sttp/client/Json4sTests.scala rename to json/json4s/src/test/scala/sttp/client3/Json4sTests.scala index e7a876d137..a61a409473 100644 --- a/json/json4s/src/test/scala/sttp/client/Json4sTests.scala +++ b/json/json4s/src/test/scala/sttp/client3/Json4sTests.scala @@ -1,9 +1,9 @@ -package sttp.client +package sttp.client3 import org.json4s.ParserUtil.ParseException import org.json4s.{DefaultFormats, MappingException, native} import org.scalatest._ -import sttp.client.internal._ +import sttp.client3.internal._ import sttp.model._ import scala.language.higherKinds diff --git a/json/play-json/src/main/scala/sttp/client/playJson/SttpPlayJsonApi.scala b/json/play-json/src/main/scala/sttp/client3/playJson/SttpPlayJsonApi.scala similarity index 95% rename from json/play-json/src/main/scala/sttp/client/playJson/SttpPlayJsonApi.scala rename to json/play-json/src/main/scala/sttp/client3/playJson/SttpPlayJsonApi.scala index 935739e5ca..189339dd91 100644 --- a/json/play-json/src/main/scala/sttp/client/playJson/SttpPlayJsonApi.scala +++ b/json/play-json/src/main/scala/sttp/client3/playJson/SttpPlayJsonApi.scala @@ -1,9 +1,9 @@ -package sttp.client.playJson +package sttp.client3.playJson import play.api.libs.json.{JsError, Json, Reads, Writes} -import sttp.client.internal.Utf8 -import sttp.client.json._ -import sttp.client.{IsOption, JsonInput, ResponseAs, _} +import sttp.client3.internal.Utf8 +import sttp.client3.json._ +import sttp.client3.{IsOption, JsonInput, ResponseAs, _} import sttp.model.MediaType import scala.util.{Failure, Success, Try} diff --git a/json/play-json/src/main/scala/sttp/client/playJson/package.scala b/json/play-json/src/main/scala/sttp/client3/playJson/package.scala similarity index 70% rename from json/play-json/src/main/scala/sttp/client/playJson/package.scala rename to json/play-json/src/main/scala/sttp/client3/playJson/package.scala index 26a96831f1..7cbe5b024d 100644 --- a/json/play-json/src/main/scala/sttp/client/playJson/package.scala +++ b/json/play-json/src/main/scala/sttp/client3/playJson/package.scala @@ -1,3 +1,3 @@ -package sttp.client +package sttp.client3 package object playJson extends SttpPlayJsonApi diff --git a/json/play-json/src/test/scala/sttp/client/PlayJsonTests.scala b/json/play-json/src/test/scala/sttp/client3/PlayJsonTests.scala similarity index 93% rename from json/play-json/src/test/scala/sttp/client/PlayJsonTests.scala rename to json/play-json/src/test/scala/sttp/client3/PlayJsonTests.scala index 96b58f41cd..a9ceb82a46 100644 --- a/json/play-json/src/test/scala/sttp/client/PlayJsonTests.scala +++ b/json/play-json/src/test/scala/sttp/client3/PlayJsonTests.scala @@ -1,7 +1,7 @@ -package sttp.client +package sttp.client3 -import sttp.client.internal._ -import sttp.client.playJson._ +import sttp.client3.internal._ +import sttp.client3.playJson._ import sttp.model._ import play.api.libs.json._ import org.scalatest._ @@ -60,8 +60,7 @@ class PlayJsonTests extends AnyFlatSpec with Matchers with EitherValues { it should "fail to decode from empty input" in { val responseAs = asJson[Inner] - runJsonResponseAs(responseAs)("") should matchPattern { - case Left(DeserializationException("", _)) => + runJsonResponseAs(responseAs)("") should matchPattern { case Left(DeserializationException("", _)) => } } @@ -70,8 +69,7 @@ class PlayJsonTests extends AnyFlatSpec with Matchers with EitherValues { val responseAs = asJson[Outer] - runJsonResponseAs(responseAs)(body) should matchPattern { - case Left(DeserializationException(`body`, _)) => + runJsonResponseAs(responseAs)(body) should matchPattern { case Left(DeserializationException(`body`, _)) => } } diff --git a/json/spray-json/src/main/scala/sttp/client/sprayJson/SttpSprayJsonApi.scala b/json/spray-json/src/main/scala/sttp/client3/sprayJson/SttpSprayJsonApi.scala similarity index 94% rename from json/spray-json/src/main/scala/sttp/client/sprayJson/SttpSprayJsonApi.scala rename to json/spray-json/src/main/scala/sttp/client3/sprayJson/SttpSprayJsonApi.scala index 22d61a5ff4..469d138a15 100644 --- a/json/spray-json/src/main/scala/sttp/client/sprayJson/SttpSprayJsonApi.scala +++ b/json/spray-json/src/main/scala/sttp/client3/sprayJson/SttpSprayJsonApi.scala @@ -1,9 +1,9 @@ -package sttp.client.sprayJson +package sttp.client3.sprayJson import spray.json.{DeserializationException => _, _} -import sttp.client.internal.Utf8 -import sttp.client.{IsOption, ResponseAs, _} -import sttp.client.json._ +import sttp.client3.internal.Utf8 +import sttp.client3.{IsOption, ResponseAs, _} +import sttp.client3.json._ import sttp.model._ trait SttpSprayJsonApi { diff --git a/json/spray-json/src/main/scala/sttp/client/sprayJson/package.scala b/json/spray-json/src/main/scala/sttp/client3/sprayJson/package.scala similarity index 70% rename from json/spray-json/src/main/scala/sttp/client/sprayJson/package.scala rename to json/spray-json/src/main/scala/sttp/client3/sprayJson/package.scala index 8a69535af2..fb8bc59026 100644 --- a/json/spray-json/src/main/scala/sttp/client/sprayJson/package.scala +++ b/json/spray-json/src/main/scala/sttp/client3/sprayJson/package.scala @@ -1,3 +1,3 @@ -package sttp.client +package sttp.client3 package object sprayJson extends SttpSprayJsonApi diff --git a/json/spray-json/src/test/scala/sttp/client/SprayJsonTests.scala b/json/spray-json/src/test/scala/sttp/client3/SprayJsonTests.scala similarity index 96% rename from json/spray-json/src/test/scala/sttp/client/SprayJsonTests.scala rename to json/spray-json/src/test/scala/sttp/client3/SprayJsonTests.scala index f929591340..6d088e648b 100644 --- a/json/spray-json/src/test/scala/sttp/client/SprayJsonTests.scala +++ b/json/spray-json/src/test/scala/sttp/client3/SprayJsonTests.scala @@ -1,12 +1,12 @@ -package sttp.client +package sttp.client3 import org.scalatest.EitherValues import spray.json.DefaultJsonProtocol._ import spray.json.JsonParser.ParsingException import spray.json.{DeserializationException => _, _} -import sttp.client.SprayJsonTests._ -import sttp.client.internal.Utf8 -import sttp.client.sprayJson._ +import sttp.client3.SprayJsonTests._ +import sttp.client3.internal.Utf8 +import sttp.client3.sprayJson._ import sttp.model.{StatusCode, _} import org.scalatest.flatspec.AnyFlatSpec import org.scalatest.matchers.should.Matchers diff --git a/logging/scribe/src/main/scala/sttp/client/logging/scribe/ScribeLogger.scala b/logging/scribe/src/main/scala/sttp/client3/logging/scribe/ScribeLogger.scala similarity index 92% rename from logging/scribe/src/main/scala/sttp/client/logging/scribe/ScribeLogger.scala rename to logging/scribe/src/main/scala/sttp/client3/logging/scribe/ScribeLogger.scala index fa480ede0d..9888b156e9 100644 --- a/logging/scribe/src/main/scala/sttp/client/logging/scribe/ScribeLogger.scala +++ b/logging/scribe/src/main/scala/sttp/client3/logging/scribe/ScribeLogger.scala @@ -1,6 +1,6 @@ -package sttp.client.logging.scribe +package sttp.client3.logging.scribe -import sttp.client.logging.Logger +import sttp.client3.logging.Logger import sttp.monad.MonadError case class ScribeLogger[F[_]](monad: MonadError[F]) extends Logger[F] { diff --git a/logging/scribe/src/main/scala/sttp/client/logging/scribe/ScribeLoggingBackend.scala b/logging/scribe/src/main/scala/sttp/client3/logging/scribe/ScribeLoggingBackend.scala similarity index 85% rename from logging/scribe/src/main/scala/sttp/client/logging/scribe/ScribeLoggingBackend.scala rename to logging/scribe/src/main/scala/sttp/client3/logging/scribe/ScribeLoggingBackend.scala index d838ec84ef..b7f3a611d3 100644 --- a/logging/scribe/src/main/scala/sttp/client/logging/scribe/ScribeLoggingBackend.scala +++ b/logging/scribe/src/main/scala/sttp/client3/logging/scribe/ScribeLoggingBackend.scala @@ -1,7 +1,7 @@ -package sttp.client.logging.scribe +package sttp.client3.logging.scribe -import sttp.client._ -import sttp.client.logging.LoggingBackend +import sttp.client3._ +import sttp.client3.logging.LoggingBackend import sttp.model.HeaderNames object ScribeLoggingBackend { diff --git a/logging/slf4j/src/main/scala/sttp/client/logging/slf4j/Slf4jLogger.scala b/logging/slf4j/src/main/scala/sttp/client3/logging/slf4j/Slf4jLogger.scala similarity index 95% rename from logging/slf4j/src/main/scala/sttp/client/logging/slf4j/Slf4jLogger.scala rename to logging/slf4j/src/main/scala/sttp/client3/logging/slf4j/Slf4jLogger.scala index f912942ff4..ddd78b339e 100644 --- a/logging/slf4j/src/main/scala/sttp/client/logging/slf4j/Slf4jLogger.scala +++ b/logging/slf4j/src/main/scala/sttp/client3/logging/slf4j/Slf4jLogger.scala @@ -1,7 +1,7 @@ -package sttp.client.logging.slf4j +package sttp.client3.logging.slf4j import org.slf4j.LoggerFactory -import sttp.client.logging.Logger +import sttp.client3.logging.Logger import sttp.monad.MonadError class Slf4jLogger[F[_]](name: String, monad: MonadError[F]) extends Logger[F] { diff --git a/logging/slf4j/src/main/scala/sttp/client/logging/slf4j/Slf4jLoggingBackend.scala b/logging/slf4j/src/main/scala/sttp/client3/logging/slf4j/Slf4jLoggingBackend.scala similarity index 72% rename from logging/slf4j/src/main/scala/sttp/client/logging/slf4j/Slf4jLoggingBackend.scala rename to logging/slf4j/src/main/scala/sttp/client3/logging/slf4j/Slf4jLoggingBackend.scala index 8815dc9ec6..fe2a7cc071 100644 --- a/logging/slf4j/src/main/scala/sttp/client/logging/slf4j/Slf4jLoggingBackend.scala +++ b/logging/slf4j/src/main/scala/sttp/client3/logging/slf4j/Slf4jLoggingBackend.scala @@ -1,7 +1,7 @@ -package sttp.client.logging.slf4j +package sttp.client3.logging.slf4j -import sttp.client._ -import sttp.client.logging.LoggingBackend +import sttp.client3._ +import sttp.client3.logging.LoggingBackend import sttp.model.HeaderNames object Slf4jLoggingBackend { @@ -13,7 +13,7 @@ object Slf4jLoggingBackend { logResponseBody: Boolean = false, sensitiveHeaders: Set[String] = HeaderNames.SensitiveHeaders ): SttpBackend[F, S] = { - val logger = new Slf4jLogger("sttp.client.logging.slf4j.Slf4jLoggingBackend", delegate.responseMonad) + val logger = new Slf4jLogger("sttp.client3.logging.slf4j.Slf4jLoggingBackend", delegate.responseMonad) LoggingBackend( delegate, logger, diff --git a/manual-tests/proxy-digest-test.md b/manual-tests/proxy-digest-test.md index 8c6a271250..e2ee750044 100644 --- a/manual-tests/proxy-digest-test.md +++ b/manual-tests/proxy-digest-test.md @@ -64,4 +64,4 @@ The document has moved Remove the `@Ignore` annotation from `OkHttpSyncDigestAuthProxyManualTest` and run: -`sbt okhttpBackend/testOnly sttp.client.okhttp.OkHttpSyncDigestAuthProxyManualTest` +`sbt okhttpBackend/testOnly sttp.client3.okhttp.OkHttpSyncDigestAuthProxyManualTest` diff --git a/metrics/open-tracing-backend/src/main/scala/sttp/client/opentracing/OpenTracingBackend.scala b/metrics/open-tracing-backend/src/main/scala/sttp/client3/opentracing/OpenTracingBackend.scala similarity index 95% rename from metrics/open-tracing-backend/src/main/scala/sttp/client/opentracing/OpenTracingBackend.scala rename to metrics/open-tracing-backend/src/main/scala/sttp/client3/opentracing/OpenTracingBackend.scala index db68b8db68..ff9a056bcb 100644 --- a/metrics/open-tracing-backend/src/main/scala/sttp/client/opentracing/OpenTracingBackend.scala +++ b/metrics/open-tracing-backend/src/main/scala/sttp/client3/opentracing/OpenTracingBackend.scala @@ -1,4 +1,4 @@ -package sttp.client.opentracing +package sttp.client3.opentracing import io.opentracing.tag.Tags import io.opentracing.{Span, Tracer} @@ -7,8 +7,8 @@ import io.opentracing.Tracer.SpanBuilder import sttp.capabilities.Effect import sttp.monad.MonadError import sttp.monad.syntax._ -import sttp.client.{FollowRedirectsBackend, Request, Response, SttpBackend} -import sttp.client.opentracing.OpenTracingBackend._ +import sttp.client3.{FollowRedirectsBackend, Request, Response, SttpBackend} +import sttp.client3.opentracing.OpenTracingBackend._ import scala.collection.JavaConverters._ diff --git a/metrics/open-tracing-backend/src/main/scala/sttp/client/opentracing/RequestBuilderCarrier.scala b/metrics/open-tracing-backend/src/main/scala/sttp/client3/opentracing/RequestBuilderCarrier.scala similarity index 89% rename from metrics/open-tracing-backend/src/main/scala/sttp/client/opentracing/RequestBuilderCarrier.scala rename to metrics/open-tracing-backend/src/main/scala/sttp/client3/opentracing/RequestBuilderCarrier.scala index ddb2d90d8f..3ccfde06f9 100644 --- a/metrics/open-tracing-backend/src/main/scala/sttp/client/opentracing/RequestBuilderCarrier.scala +++ b/metrics/open-tracing-backend/src/main/scala/sttp/client3/opentracing/RequestBuilderCarrier.scala @@ -1,9 +1,9 @@ -package sttp.client.opentracing +package sttp.client3.opentracing import java.util import io.opentracing.propagation.TextMap -import sttp.client.Request +import sttp.client3.Request class RequestBuilderCarrier(requestBuilder: RequestBuilderAdapter[_, _]) extends TextMap { override def put(key: String, value: String): Unit = requestBuilder.header(key, value) diff --git a/metrics/open-tracing-backend/src/test/scala/sttp/client/opentracing/OpenTracingBackendTest.scala b/metrics/open-tracing-backend/src/test/scala/sttp/client3/opentracing/OpenTracingBackendTest.scala similarity index 96% rename from metrics/open-tracing-backend/src/test/scala/sttp/client/opentracing/OpenTracingBackendTest.scala rename to metrics/open-tracing-backend/src/test/scala/sttp/client3/opentracing/OpenTracingBackendTest.scala index 4b2fd61b54..a91762b6ff 100644 --- a/metrics/open-tracing-backend/src/test/scala/sttp/client/opentracing/OpenTracingBackendTest.scala +++ b/metrics/open-tracing-backend/src/test/scala/sttp/client3/opentracing/OpenTracingBackendTest.scala @@ -1,14 +1,14 @@ -package sttp.client.opentracing +package sttp.client3.opentracing import io.opentracing.mock.MockTracer import io.opentracing.tag.Tags import org.scalatest.BeforeAndAfter import org.scalatest.flatspec.AnyFlatSpec import org.scalatest.matchers.should.Matchers -import sttp.client.monad.IdMonad -import sttp.client.testing.SttpBackendStub -import sttp.client.{Identity, SttpBackend, _} -import sttp.client.opentracing.OpenTracingBackend._ +import sttp.client3.monad.IdMonad +import sttp.client3.testing.SttpBackendStub +import sttp.client3.{Identity, SttpBackend, _} +import sttp.client3.opentracing.OpenTracingBackend._ import sttp.model.{Method, StatusCode} import scala.collection.JavaConverters._ diff --git a/metrics/prometheus-backend/src/main/scala/sttp/client/prometheus/PrometheusBackend.scala b/metrics/prometheus-backend/src/main/scala/sttp/client3/prometheus/PrometheusBackend.scala similarity index 96% rename from metrics/prometheus-backend/src/main/scala/sttp/client/prometheus/PrometheusBackend.scala rename to metrics/prometheus-backend/src/main/scala/sttp/client3/prometheus/PrometheusBackend.scala index f5d4d85771..8f2f8e2b35 100644 --- a/metrics/prometheus-backend/src/main/scala/sttp/client/prometheus/PrometheusBackend.scala +++ b/metrics/prometheus-backend/src/main/scala/sttp/client3/prometheus/PrometheusBackend.scala @@ -1,11 +1,11 @@ -package sttp.client.prometheus +package sttp.client3.prometheus import java.util.concurrent.ConcurrentHashMap -import sttp.client.{FollowRedirectsBackend, Identity, Request, Response, SttpBackend} +import sttp.client3.{FollowRedirectsBackend, Identity, Request, Response, SttpBackend} import io.prometheus.client.{CollectorRegistry, Counter, Gauge, Histogram} -import sttp.client.listener.{ListenerBackend, RequestListener} -import sttp.client.prometheus.PrometheusBackend.RequestCollectors +import sttp.client3.listener.{ListenerBackend, RequestListener} +import sttp.client3.prometheus.PrometheusBackend.RequestCollectors import scala.collection.mutable diff --git a/metrics/prometheus-backend/src/test/scala/sttp/client/prometheus/PrometheusBackendTest.scala b/metrics/prometheus-backend/src/test/scala/sttp/client3/prometheus/PrometheusBackendTest.scala similarity index 98% rename from metrics/prometheus-backend/src/test/scala/sttp/client/prometheus/PrometheusBackendTest.scala rename to metrics/prometheus-backend/src/test/scala/sttp/client3/prometheus/PrometheusBackendTest.scala index 27cbe448e0..0469f02bee 100644 --- a/metrics/prometheus-backend/src/test/scala/sttp/client/prometheus/PrometheusBackendTest.scala +++ b/metrics/prometheus-backend/src/test/scala/sttp/client3/prometheus/PrometheusBackendTest.scala @@ -1,13 +1,13 @@ -package sttp.client.prometheus +package sttp.client3.prometheus import java.lang import java.util.concurrent.CountDownLatch -import sttp.client._ +import sttp.client3._ import io.prometheus.client.CollectorRegistry import org.scalatest.concurrent.{Eventually, IntegrationPatience} import org.scalatest.{BeforeAndAfter, OptionValues} -import sttp.client.testing.SttpBackendStub +import sttp.client3.testing.SttpBackendStub import sttp.model.StatusCode import scala.concurrent.ExecutionContext.Implicits.global diff --git a/metrics/zio-telemetry-open-tracing-backend/src/main/scala/sttp/client/ziotelemetry/opentracing/ZioTelemetryOpenTracingBackend.scala b/metrics/zio-telemetry-open-tracing-backend/src/main/scala/sttp/client3/ziotelemetry/opentracing/ZioTelemetryOpenTracingBackend.scala similarity index 93% rename from metrics/zio-telemetry-open-tracing-backend/src/main/scala/sttp/client/ziotelemetry/opentracing/ZioTelemetryOpenTracingBackend.scala rename to metrics/zio-telemetry-open-tracing-backend/src/main/scala/sttp/client3/ziotelemetry/opentracing/ZioTelemetryOpenTracingBackend.scala index fefc321e2a..61b24c5b8c 100644 --- a/metrics/zio-telemetry-open-tracing-backend/src/main/scala/sttp/client/ziotelemetry/opentracing/ZioTelemetryOpenTracingBackend.scala +++ b/metrics/zio-telemetry-open-tracing-backend/src/main/scala/sttp/client3/ziotelemetry/opentracing/ZioTelemetryOpenTracingBackend.scala @@ -1,11 +1,11 @@ -package sttp.client.ziotelemetry.opentracing +package sttp.client3.ziotelemetry.opentracing import io.opentracing.propagation.{Format, TextMapAdapter} import sttp.capabilities.Effect import scala.jdk.CollectionConverters._ -import sttp.client._ -import sttp.client.impl.zio.{ExtendEnv, RIOMonadAsyncError} +import sttp.client3._ +import sttp.client3.impl.zio.{ExtendEnv, RIOMonadAsyncError} import sttp.monad.MonadError import zio._ import zio.telemetry.opentracing._ diff --git a/okhttp-backend/monix/src/main/scala/sttp/client/okhttp/monix/OkHttpMonixBackend.scala b/okhttp-backend/monix/src/main/scala/sttp/client3/okhttp/monix/OkHttpMonixBackend.scala similarity index 93% rename from okhttp-backend/monix/src/main/scala/sttp/client/okhttp/monix/OkHttpMonixBackend.scala rename to okhttp-backend/monix/src/main/scala/sttp/client3/okhttp/monix/OkHttpMonixBackend.scala index aa74f9acd2..4b474881c4 100644 --- a/okhttp-backend/monix/src/main/scala/sttp/client/okhttp/monix/OkHttpMonixBackend.scala +++ b/okhttp-backend/monix/src/main/scala/sttp/client3/okhttp/monix/OkHttpMonixBackend.scala @@ -1,4 +1,4 @@ -package sttp.client.okhttp.monix +package sttp.client3.okhttp.monix import java.io.InputStream import java.nio.ByteBuffer @@ -14,13 +14,13 @@ import okhttp3.{MediaType, OkHttpClient, RequestBody => OkHttpRequestBody} import okio.BufferedSink import sttp.capabilities.WebSockets import sttp.capabilities.monix.MonixStreams -import sttp.client.impl.monix.{MonixSimpleQueue, MonixWebSockets, TaskMonadAsyncError} -import sttp.client.internal.ws.SimpleQueue +import sttp.client3.impl.monix.{MonixSimpleQueue, MonixWebSockets, TaskMonadAsyncError} +import sttp.client3.internal.ws.SimpleQueue import sttp.monad.MonadError -import sttp.client.okhttp.OkHttpBackend.EncodingHandler -import sttp.client.okhttp.{BodyFromOkHttp, BodyToOkHttp, OkHttpAsyncBackend, OkHttpBackend} -import sttp.client.testing.SttpBackendStub -import sttp.client.{SttpBackend, _} +import sttp.client3.okhttp.OkHttpBackend.EncodingHandler +import sttp.client3.okhttp.{BodyFromOkHttp, BodyToOkHttp, OkHttpAsyncBackend, OkHttpBackend} +import sttp.client3.testing.SttpBackendStub +import sttp.client3.{SttpBackend, _} import sttp.ws.{WebSocket, WebSocketFrame} import scala.concurrent.Future diff --git a/okhttp-backend/monix/src/test/scala/sttp/client/okhttp/monix/OkHttpMonixHttpTest.scala b/okhttp-backend/monix/src/test/scala/sttp/client3/okhttp/monix/OkHttpMonixHttpTest.scala similarity index 66% rename from okhttp-backend/monix/src/test/scala/sttp/client/okhttp/monix/OkHttpMonixHttpTest.scala rename to okhttp-backend/monix/src/test/scala/sttp/client3/okhttp/monix/OkHttpMonixHttpTest.scala index afd2870b14..d674f86786 100644 --- a/okhttp-backend/monix/src/test/scala/sttp/client/okhttp/monix/OkHttpMonixHttpTest.scala +++ b/okhttp-backend/monix/src/test/scala/sttp/client3/okhttp/monix/OkHttpMonixHttpTest.scala @@ -1,11 +1,11 @@ -package sttp.client.okhttp.monix +package sttp.client3.okhttp.monix import monix.eval.Task import monix.execution.Scheduler.Implicits.global import sttp.capabilities.monix.MonixStreams -import sttp.client.SttpBackend -import sttp.client.impl.monix.convertMonixTaskToFuture -import sttp.client.testing.{ConvertToFuture, HttpTest} +import sttp.client3.SttpBackend +import sttp.client3.impl.monix.convertMonixTaskToFuture +import sttp.client3.testing.{ConvertToFuture, HttpTest} class OkHttpMonixHttpTest extends HttpTest[Task] { diff --git a/okhttp-backend/monix/src/test/scala/sttp/client/okhttp/monix/OkHttpMonixStreamingTest.scala b/okhttp-backend/monix/src/test/scala/sttp/client3/okhttp/monix/OkHttpMonixStreamingTest.scala similarity index 70% rename from okhttp-backend/monix/src/test/scala/sttp/client/okhttp/monix/OkHttpMonixStreamingTest.scala rename to okhttp-backend/monix/src/test/scala/sttp/client3/okhttp/monix/OkHttpMonixStreamingTest.scala index 108745a92f..d453428311 100644 --- a/okhttp-backend/monix/src/test/scala/sttp/client/okhttp/monix/OkHttpMonixStreamingTest.scala +++ b/okhttp-backend/monix/src/test/scala/sttp/client3/okhttp/monix/OkHttpMonixStreamingTest.scala @@ -1,10 +1,10 @@ -package sttp.client.okhttp.monix +package sttp.client3.okhttp.monix import monix.eval.Task import monix.execution.Scheduler.Implicits.global import sttp.capabilities.monix.MonixStreams -import sttp.client.SttpBackend -import sttp.client.impl.monix.MonixStreamingTest +import sttp.client3.SttpBackend +import sttp.client3.impl.monix.MonixStreamingTest class OkHttpMonixStreamingTest extends MonixStreamingTest { override val backend: SttpBackend[Task, MonixStreams] = diff --git a/okhttp-backend/monix/src/test/scala/sttp/client/okhttp/monix/OkHttpMonixWebSocketTest.scala b/okhttp-backend/monix/src/test/scala/sttp/client3/okhttp/monix/OkHttpMonixWebSocketTest.scala similarity index 83% rename from okhttp-backend/monix/src/test/scala/sttp/client/okhttp/monix/OkHttpMonixWebSocketTest.scala rename to okhttp-backend/monix/src/test/scala/sttp/client3/okhttp/monix/OkHttpMonixWebSocketTest.scala index 87e66c95c5..4b9d7cf91c 100644 --- a/okhttp-backend/monix/src/test/scala/sttp/client/okhttp/monix/OkHttpMonixWebSocketTest.scala +++ b/okhttp-backend/monix/src/test/scala/sttp/client3/okhttp/monix/OkHttpMonixWebSocketTest.scala @@ -1,16 +1,16 @@ -package sttp.client.okhttp.monix +package sttp.client3.okhttp.monix import monix.eval.Task import monix.execution.Scheduler.Implicits.global import monix.reactive.Observable import sttp.capabilities.WebSockets import sttp.capabilities.monix.MonixStreams -import sttp.client._ -import sttp.client.impl.monix.{MonixWebSockets, TaskMonadAsyncError, convertMonixTaskToFuture} +import sttp.client3._ +import sttp.client3.impl.monix.{MonixWebSockets, TaskMonadAsyncError, convertMonixTaskToFuture} import sttp.monad.MonadError -import sttp.client.okhttp.OkHttpBackend -import sttp.client.testing.ConvertToFuture -import sttp.client.testing.websocket.{WebSocketBufferOverflowTest, WebSocketStreamingTest, WebSocketTest} +import sttp.client3.okhttp.OkHttpBackend +import sttp.client3.testing.ConvertToFuture +import sttp.client3.testing.websocket.{WebSocketBufferOverflowTest, WebSocketStreamingTest, WebSocketTest} import sttp.ws.WebSocketFrame import scala.concurrent.duration._ diff --git a/okhttp-backend/src/main/scala/sttp/client/okhttp/BodyFromOkHttp.scala b/okhttp-backend/src/main/scala/sttp/client3/okhttp/BodyFromOkHttp.scala similarity index 93% rename from okhttp-backend/src/main/scala/sttp/client/okhttp/BodyFromOkHttp.scala rename to okhttp-backend/src/main/scala/sttp/client3/okhttp/BodyFromOkHttp.scala index 8e4562791d..302898a35a 100644 --- a/okhttp-backend/src/main/scala/sttp/client/okhttp/BodyFromOkHttp.scala +++ b/okhttp-backend/src/main/scala/sttp/client3/okhttp/BodyFromOkHttp.scala @@ -1,11 +1,11 @@ -package sttp.client.okhttp +package sttp.client3.okhttp import java.io.{BufferedInputStream, ByteArrayInputStream, FileInputStream, InputStream} import sttp.capabilities.Streams -import sttp.client.internal.{BodyFromResponseAs, FileHelpers, SttpFile, toByteArray} -import sttp.client.ws.{GotAWebSocketException, NotAWebSocketException} -import sttp.client.{ +import sttp.client3.internal.{BodyFromResponseAs, FileHelpers, SttpFile, toByteArray} +import sttp.client3.ws.{GotAWebSocketException, NotAWebSocketException} +import sttp.client3.{ ResponseAs, ResponseAsWebSocket, ResponseAsWebSocketStream, diff --git a/okhttp-backend/src/main/scala/sttp/client/okhttp/BodyToOkHttp.scala b/okhttp-backend/src/main/scala/sttp/client3/okhttp/BodyToOkHttp.scala similarity index 97% rename from okhttp-backend/src/main/scala/sttp/client/okhttp/BodyToOkHttp.scala rename to okhttp-backend/src/main/scala/sttp/client3/okhttp/BodyToOkHttp.scala index adb910c6fe..347a31953b 100644 --- a/okhttp-backend/src/main/scala/sttp/client/okhttp/BodyToOkHttp.scala +++ b/okhttp-backend/src/main/scala/sttp/client3/okhttp/BodyToOkHttp.scala @@ -1,4 +1,4 @@ -package sttp.client.okhttp +package sttp.client3.okhttp import okhttp3.{ MediaType, @@ -8,7 +8,7 @@ import okhttp3.{ } import okio.{BufferedSink, ByteString, Okio} import sttp.capabilities.Streams -import sttp.client.{ +import sttp.client3.{ BasicRequestBody, ByteArrayBody, ByteBufferBody, diff --git a/okhttp-backend/src/main/scala/sttp/client/okhttp/OkHttpAsyncBackend.scala b/okhttp-backend/src/main/scala/sttp/client3/okhttp/OkHttpAsyncBackend.scala similarity index 93% rename from okhttp-backend/src/main/scala/sttp/client/okhttp/OkHttpAsyncBackend.scala rename to okhttp-backend/src/main/scala/sttp/client3/okhttp/OkHttpAsyncBackend.scala index 12ace2a5e3..e1bedc6883 100644 --- a/okhttp-backend/src/main/scala/sttp/client/okhttp/OkHttpAsyncBackend.scala +++ b/okhttp-backend/src/main/scala/sttp/client3/okhttp/OkHttpAsyncBackend.scala @@ -1,14 +1,14 @@ -package sttp.client.okhttp +package sttp.client3.okhttp import java.io.IOException import java.util.concurrent.atomic.AtomicBoolean import okhttp3.{Call, Callback, OkHttpClient, Response => OkHttpResponse, WebSocket => OkHttpWebSocket} import sttp.capabilities.Streams -import sttp.client.internal.ws.{SimpleQueue, WebSocketEvent} +import sttp.client3.internal.ws.{SimpleQueue, WebSocketEvent} import sttp.monad.syntax._ -import sttp.client.okhttp.OkHttpBackend.EncodingHandler -import sttp.client.{Request, Response, ignore} +import sttp.client3.okhttp.OkHttpBackend.EncodingHandler +import sttp.client3.{Request, Response, ignore} import sttp.monad.{Canceler, MonadAsyncError} abstract class OkHttpAsyncBackend[F[_], S <: Streams[S], P]( diff --git a/okhttp-backend/src/main/scala/sttp/client/okhttp/OkHttpBackend.scala b/okhttp-backend/src/main/scala/sttp/client3/okhttp/OkHttpBackend.scala similarity index 95% rename from okhttp-backend/src/main/scala/sttp/client/okhttp/OkHttpBackend.scala rename to okhttp-backend/src/main/scala/sttp/client3/okhttp/OkHttpBackend.scala index a1ce85e1cf..921845b9be 100644 --- a/okhttp-backend/src/main/scala/sttp/client/okhttp/OkHttpBackend.scala +++ b/okhttp-backend/src/main/scala/sttp/client3/okhttp/OkHttpBackend.scala @@ -1,4 +1,4 @@ -package sttp.client.okhttp +package sttp.client3.okhttp import java.io.{InputStream, UnsupportedEncodingException} import java.util.concurrent.TimeUnit @@ -15,11 +15,11 @@ import okhttp3.{ Response => OkHttpResponse } import sttp.capabilities.{Effect, Streams} -import sttp.client.SttpBackendOptions.Proxy -import sttp.client.SttpClientException.ReadException -import sttp.client.internal.ws.SimpleQueue -import sttp.client.okhttp.OkHttpBackend.EncodingHandler -import sttp.client.{Response, SttpBackend, SttpBackendOptions, _} +import sttp.client3.SttpBackendOptions.Proxy +import sttp.client3.SttpClientException.ReadException +import sttp.client3.internal.ws.SimpleQueue +import sttp.client3.okhttp.OkHttpBackend.EncodingHandler +import sttp.client3.{Response, SttpBackend, SttpBackendOptions, _} import sttp.model._ import scala.collection.JavaConverters._ diff --git a/okhttp-backend/src/main/scala/sttp/client/okhttp/OkHttpFutureBackend.scala b/okhttp-backend/src/main/scala/sttp/client3/okhttp/OkHttpFutureBackend.scala similarity index 90% rename from okhttp-backend/src/main/scala/sttp/client/okhttp/OkHttpFutureBackend.scala rename to okhttp-backend/src/main/scala/sttp/client3/okhttp/OkHttpFutureBackend.scala index e374aef2c0..2c953daa7d 100644 --- a/okhttp-backend/src/main/scala/sttp/client/okhttp/OkHttpFutureBackend.scala +++ b/okhttp-backend/src/main/scala/sttp/client3/okhttp/OkHttpFutureBackend.scala @@ -1,14 +1,14 @@ -package sttp.client.okhttp +package sttp.client3.okhttp import java.io.InputStream import okhttp3.{OkHttpClient, RequestBody => OkHttpRequestBody} import sttp.capabilities.{Streams, WebSockets} -import sttp.client.internal.NoStreams -import sttp.client.internal.ws.{FutureSimpleQueue, SimpleQueue} -import sttp.client.okhttp.OkHttpBackend.EncodingHandler -import sttp.client.testing.SttpBackendStub -import sttp.client.{DefaultReadTimeout, FollowRedirectsBackend, SttpBackend, SttpBackendOptions} +import sttp.client3.internal.NoStreams +import sttp.client3.internal.ws.{FutureSimpleQueue, SimpleQueue} +import sttp.client3.okhttp.OkHttpBackend.EncodingHandler +import sttp.client3.testing.SttpBackendStub +import sttp.client3.{DefaultReadTimeout, FollowRedirectsBackend, SttpBackend, SttpBackendOptions} import sttp.monad.{FutureMonad, MonadError} import sttp.ws.WebSocket diff --git a/okhttp-backend/src/main/scala/sttp/client/okhttp/OkHttpSyncBackend.scala b/okhttp-backend/src/main/scala/sttp/client3/okhttp/OkHttpSyncBackend.scala similarity index 94% rename from okhttp-backend/src/main/scala/sttp/client/okhttp/OkHttpSyncBackend.scala rename to okhttp-backend/src/main/scala/sttp/client3/okhttp/OkHttpSyncBackend.scala index 19f5161193..069c0df827 100644 --- a/okhttp-backend/src/main/scala/sttp/client/okhttp/OkHttpSyncBackend.scala +++ b/okhttp-backend/src/main/scala/sttp/client3/okhttp/OkHttpSyncBackend.scala @@ -1,4 +1,4 @@ -package sttp.client.okhttp +package sttp.client3.okhttp import java.io.InputStream import java.util.concurrent.ArrayBlockingQueue @@ -6,12 +6,12 @@ import java.util.concurrent.atomic.AtomicBoolean import okhttp3.{OkHttpClient, RequestBody => OkHttpRequestBody} import sttp.capabilities.{Streams, WebSockets} -import sttp.client.internal.NoStreams -import sttp.client.internal.ws.{SimpleQueue, SyncQueue, WebSocketEvent} -import sttp.client.monad.IdMonad -import sttp.client.okhttp.OkHttpBackend.EncodingHandler -import sttp.client.testing.SttpBackendStub -import sttp.client.{ +import sttp.client3.internal.NoStreams +import sttp.client3.internal.ws.{SimpleQueue, SyncQueue, WebSocketEvent} +import sttp.client3.monad.IdMonad +import sttp.client3.okhttp.OkHttpBackend.EncodingHandler +import sttp.client3.testing.SttpBackendStub +import sttp.client3.{ DefaultReadTimeout, FollowRedirectsBackend, Identity, diff --git a/okhttp-backend/src/main/scala/sttp/client/okhttp/WebSocketImpl.scala b/okhttp-backend/src/main/scala/sttp/client3/okhttp/WebSocketImpl.scala similarity index 98% rename from okhttp-backend/src/main/scala/sttp/client/okhttp/WebSocketImpl.scala rename to okhttp-backend/src/main/scala/sttp/client3/okhttp/WebSocketImpl.scala index 2d907fd5c0..8ec488576a 100644 --- a/okhttp-backend/src/main/scala/sttp/client/okhttp/WebSocketImpl.scala +++ b/okhttp-backend/src/main/scala/sttp/client3/okhttp/WebSocketImpl.scala @@ -1,10 +1,10 @@ -package sttp.client.okhttp +package sttp.client3.okhttp import java.util.concurrent.atomic.AtomicBoolean import okhttp3.{WebSocketListener, Headers => OkHttpHeaders, Response => OkHttpResponse, WebSocket => OkHttpWebSocket} import okio.ByteString -import sttp.client.internal.ws.{SimpleQueue, WebSocketEvent} +import sttp.client3.internal.ws.{SimpleQueue, WebSocketEvent} import sttp.model.{Header, Headers} import sttp.monad.MonadError import sttp.monad.syntax._ diff --git a/okhttp-backend/src/main/scala/sttp/client/okhttp/quick.scala b/okhttp-backend/src/main/scala/sttp/client3/okhttp/quick.scala similarity index 74% rename from okhttp-backend/src/main/scala/sttp/client/okhttp/quick.scala rename to okhttp-backend/src/main/scala/sttp/client3/okhttp/quick.scala index 57b943db4d..c547c66a32 100644 --- a/okhttp-backend/src/main/scala/sttp/client/okhttp/quick.scala +++ b/okhttp-backend/src/main/scala/sttp/client3/okhttp/quick.scala @@ -1,7 +1,7 @@ -package sttp.client.okhttp +package sttp.client3.okhttp import sttp.capabilities.WebSockets -import sttp.client._ +import sttp.client3._ object quick extends SttpApi { lazy val backend: SttpBackend[Identity, WebSockets] = OkHttpSyncBackend() diff --git a/okhttp-backend/src/test/scala/sttp/client/okhttp/OkHttpFutureHttpTest.scala b/okhttp-backend/src/test/scala/sttp/client3/okhttp/OkHttpFutureHttpTest.scala similarity index 71% rename from okhttp-backend/src/test/scala/sttp/client/okhttp/OkHttpFutureHttpTest.scala rename to okhttp-backend/src/test/scala/sttp/client3/okhttp/OkHttpFutureHttpTest.scala index 5dfb8ce2ba..751e0bf68c 100644 --- a/okhttp-backend/src/test/scala/sttp/client/okhttp/OkHttpFutureHttpTest.scala +++ b/okhttp-backend/src/test/scala/sttp/client3/okhttp/OkHttpFutureHttpTest.scala @@ -1,8 +1,8 @@ -package sttp.client.okhttp +package sttp.client3.okhttp import sttp.capabilities.WebSockets -import sttp.client.SttpBackend -import sttp.client.testing.{ConvertToFuture, HttpTest} +import sttp.client3.SttpBackend +import sttp.client3.testing.{ConvertToFuture, HttpTest} import scala.concurrent.Future diff --git a/okhttp-backend/src/test/scala/sttp/client/okhttp/OkHttpFutureWebsocketTest.scala b/okhttp-backend/src/test/scala/sttp/client3/okhttp/OkHttpFutureWebsocketTest.scala similarity index 83% rename from okhttp-backend/src/test/scala/sttp/client/okhttp/OkHttpFutureWebsocketTest.scala rename to okhttp-backend/src/test/scala/sttp/client3/okhttp/OkHttpFutureWebsocketTest.scala index 1e03f28e51..0bb47c5b4e 100644 --- a/okhttp-backend/src/test/scala/sttp/client/okhttp/OkHttpFutureWebsocketTest.scala +++ b/okhttp-backend/src/test/scala/sttp/client3/okhttp/OkHttpFutureWebsocketTest.scala @@ -1,9 +1,9 @@ -package sttp.client.okhttp +package sttp.client3.okhttp import sttp.capabilities.WebSockets -import sttp.client._ -import sttp.client.testing.ConvertToFuture -import sttp.client.testing.websocket.{WebSocketBufferOverflowTest, WebSocketTest} +import sttp.client3._ +import sttp.client3.testing.ConvertToFuture +import sttp.client3.testing.websocket.{WebSocketBufferOverflowTest, WebSocketTest} import sttp.monad.{FutureMonad, MonadError} import scala.concurrent.duration._ diff --git a/okhttp-backend/src/test/scala/sttp/client/okhttp/OkHttpSyncDigestAuthProxyManualTest.scala b/okhttp-backend/src/test/scala/sttp/client3/okhttp/OkHttpSyncDigestAuthProxyManualTest.scala similarity index 88% rename from okhttp-backend/src/test/scala/sttp/client/okhttp/OkHttpSyncDigestAuthProxyManualTest.scala rename to okhttp-backend/src/test/scala/sttp/client3/okhttp/OkHttpSyncDigestAuthProxyManualTest.scala index b0e93062bc..26265a4cf8 100644 --- a/okhttp-backend/src/test/scala/sttp/client/okhttp/OkHttpSyncDigestAuthProxyManualTest.scala +++ b/okhttp-backend/src/test/scala/sttp/client3/okhttp/OkHttpSyncDigestAuthProxyManualTest.scala @@ -1,8 +1,8 @@ -package sttp.client.okhttp +package sttp.client3.okhttp import org.scalatest.Ignore -import sttp.client._ -import sttp.client.testing.{ConvertToFuture, ToFutureWrapper} +import sttp.client3._ +import sttp.client3.testing.{ConvertToFuture, ToFutureWrapper} import org.scalatest.freespec.AsyncFreeSpec import org.scalatest.matchers.should.Matchers import sttp.capabilities.WebSockets diff --git a/okhttp-backend/src/test/scala/sttp/client/okhttp/OkHttpSyncHttpTest.scala b/okhttp-backend/src/test/scala/sttp/client3/okhttp/OkHttpSyncHttpTest.scala similarity index 67% rename from okhttp-backend/src/test/scala/sttp/client/okhttp/OkHttpSyncHttpTest.scala rename to okhttp-backend/src/test/scala/sttp/client3/okhttp/OkHttpSyncHttpTest.scala index 85ce471815..20e9a83acc 100644 --- a/okhttp-backend/src/test/scala/sttp/client/okhttp/OkHttpSyncHttpTest.scala +++ b/okhttp-backend/src/test/scala/sttp/client3/okhttp/OkHttpSyncHttpTest.scala @@ -1,8 +1,8 @@ -package sttp.client.okhttp +package sttp.client3.okhttp import sttp.capabilities.WebSockets -import sttp.client.testing.{ConvertToFuture, HttpTest} -import sttp.client.{Identity, SttpBackend} +import sttp.client3.testing.{ConvertToFuture, HttpTest} +import sttp.client3.{Identity, SttpBackend} class OkHttpSyncHttpTest extends HttpTest[Identity] { override val backend: SttpBackend[Identity, WebSockets] = OkHttpSyncBackend() diff --git a/okhttp-backend/src/test/scala/sttp/client/okhttp/OkHttpSyncWebSocketTest.scala b/okhttp-backend/src/test/scala/sttp/client3/okhttp/OkHttpSyncWebSocketTest.scala similarity index 84% rename from okhttp-backend/src/test/scala/sttp/client/okhttp/OkHttpSyncWebSocketTest.scala rename to okhttp-backend/src/test/scala/sttp/client3/okhttp/OkHttpSyncWebSocketTest.scala index 77765e1721..10139f49d8 100644 --- a/okhttp-backend/src/test/scala/sttp/client/okhttp/OkHttpSyncWebSocketTest.scala +++ b/okhttp-backend/src/test/scala/sttp/client3/okhttp/OkHttpSyncWebSocketTest.scala @@ -1,13 +1,13 @@ -package sttp.client.okhttp +package sttp.client3.okhttp import org.scalatest.Assertion import sttp.capabilities.WebSockets -import sttp.client._ +import sttp.client3._ import sttp.monad.syntax._ -import sttp.client.monad.IdMonad -import sttp.client.testing.ConvertToFuture -import sttp.client.testing.HttpTest.wsEndpoint -import sttp.client.testing.websocket.WebSocketTest +import sttp.client3.monad.IdMonad +import sttp.client3.testing.ConvertToFuture +import sttp.client3.testing.HttpTest.wsEndpoint +import sttp.client3.testing.websocket.WebSocketTest import sttp.monad.MonadError import scala.concurrent.duration._ diff --git a/testing/compile/src/test/scala/sttp/client/testing/compile/EvalScala.scala b/testing/compile/src/test/scala/sttp/client3/testing/compile/EvalScala.scala similarity index 84% rename from testing/compile/src/test/scala/sttp/client/testing/compile/EvalScala.scala rename to testing/compile/src/test/scala/sttp/client3/testing/compile/EvalScala.scala index 7b9c102e4e..493ddfa600 100644 --- a/testing/compile/src/test/scala/sttp/client/testing/compile/EvalScala.scala +++ b/testing/compile/src/test/scala/sttp/client3/testing/compile/EvalScala.scala @@ -1,4 +1,4 @@ -package sttp.client.testing.compile +package sttp.client3.testing.compile object EvalScala { import scala.tools.reflect.ToolBox diff --git a/testing/compile/src/test/scala/sttp/client/testing/compile/IllTypedTests.scala b/testing/compile/src/test/scala/sttp/client3/testing/compile/IllTypedTests.scala similarity index 82% rename from testing/compile/src/test/scala/sttp/client/testing/compile/IllTypedTests.scala rename to testing/compile/src/test/scala/sttp/client3/testing/compile/IllTypedTests.scala index 385082fbae..2167abd3d6 100644 --- a/testing/compile/src/test/scala/sttp/client/testing/compile/IllTypedTests.scala +++ b/testing/compile/src/test/scala/sttp/client3/testing/compile/IllTypedTests.scala @@ -1,4 +1,4 @@ -package sttp.client.testing.compile +package sttp.client3.testing.compile import org.scalatest.flatspec.AnyFlatSpec import org.scalatest.matchers.should.Matchers @@ -9,7 +9,7 @@ class IllTypedTests extends AnyFlatSpec with Matchers { "compilation" should "fail when trying to use websockets using the HttpURLConnectionBackend backend" in { val thrown = intercept[ToolBoxError] { EvalScala(""" - import sttp.client._ + import sttp.client3._ val backend = HttpURLConnectionBackend() basicRequest.get(uri"http://example.com").response(asWebSocketUnsafe[Identity]).send(backend) @@ -17,14 +17,14 @@ class IllTypedTests extends AnyFlatSpec with Matchers { } thrown.getMessage should include( - "Cannot prove that Any with sttp.capabilities.Effect[[X]sttp.client.Identity[X]] <:< Any with sttp.capabilities.Effect[sttp.client.Identity] with sttp.capabilities.WebSockets." + "Cannot prove that Any with sttp.capabilities.Effect[[X]sttp.client3.Identity[X]] <:< Any with sttp.capabilities.Effect[sttp.client3.Identity] with sttp.capabilities.WebSockets." ) } "compilation" should "fail when trying to send a request without giving an URL" in { val thrown = intercept[ToolBoxError] { EvalScala(""" - import sttp.client._ + import sttp.client3._ val backend = HttpURLConnectionBackend() basicRequest.send(backend) """) diff --git a/testing/server/src/main/scala/sttp/client/testing/server/HttpServer.scala b/testing/server/src/main/scala/sttp/client3/testing/server/HttpServer.scala similarity index 94% rename from testing/server/src/main/scala/sttp/client/testing/server/HttpServer.scala rename to testing/server/src/main/scala/sttp/client3/testing/server/HttpServer.scala index 73a109901a..ab737040f3 100644 --- a/testing/server/src/main/scala/sttp/client/testing/server/HttpServer.scala +++ b/testing/server/src/main/scala/sttp/client3/testing/server/HttpServer.scala @@ -1,4 +1,4 @@ -package sttp.client.testing.server +package sttp.client3.testing.server import java.io.{ByteArrayOutputStream, InputStream, OutputStream} @@ -299,12 +299,12 @@ private class HttpServer(port: Int, info: String => Unit) extends AutoCloseable entity(as[String]) { (body: String) => post(complete(s"POST$body")) } } } ~ pathPrefix("strip_sensitive_headers") { - path("r1") { - redirect("/redirect/strip_sensitive_headers/result", StatusCodes.PermanentRedirect) - } ~ path("result") { - extractRequest { (req: HttpRequest) => complete(s"${req.headers.mkString(",")}") } + path("r1") { + redirect("/redirect/strip_sensitive_headers/result", StatusCodes.PermanentRedirect) + } ~ path("result") { + extractRequest { (req: HttpRequest) => complete(s"${req.headers.mkString(",")}") } + } } - } } ~ pathPrefix("error") { complete( HttpResponse( @@ -367,17 +367,16 @@ private class HttpServer(port: Int, info: String => Unit) extends AutoCloseable // send two messages and expect a correct echo response handleWebSocketMessages( Flow.fromSinkAndSourceCoupled( - Sink.fold(1) { - case (counter, msg) => - val expectedMsg = s"test$counter-echo" - msg match { - case TextMessage.Strict(`expectedMsg`) => - if (counter == 3) sourcePromise.success(Source.empty) - if (counter > 3) throw new IllegalArgumentException("Got more messages than expected!") - counter + 1 - case _ => - throw new IllegalArgumentException(s"Wrong message, expected: $expectedMsg, but got: $msg") - } + Sink.fold(1) { case (counter, msg) => + val expectedMsg = s"test$counter-echo" + msg match { + case TextMessage.Strict(`expectedMsg`) => + if (counter == 3) sourcePromise.success(Source.empty) + if (counter > 3) throw new IllegalArgumentException("Got more messages than expected!") + counter + 1 + case _ => + throw new IllegalArgumentException(s"Wrong message, expected: $expectedMsg, but got: $msg") + } }, Source(List(TextMessage("test1"), TextMessage("test2"), TextMessage("test3"))) ++ Source .lazyFutureSource(() => sourcePromise.future)