diff --git a/docs/backends/finagle.md b/docs/backends/finagle.md index c8a92c3789..4702c3d263 100644 --- a/docs/backends/finagle.md +++ b/docs/backends/finagle.md @@ -17,5 +17,4 @@ This backend depends on [finagle](https://twitter.github.io/finagle/), and offer Please note that: -* the backend does not support `SttpBackendOptions`, that is specifying proxy settings (proxies are not implemented in http4s, see [this issue](https://github.com/http4s/http4s/issues/251)), as well as configuring the connect timeout * the backend does not support non-blocking [streaming](../requests/streaming.md) or [websockets](../websockets.md). diff --git a/docs/backends/http4s.md b/docs/backends/http4s.md index f19c6b8b00..48be0edbbf 100644 --- a/docs/backends/http4s.md +++ b/docs/backends/http4s.md @@ -35,6 +35,6 @@ Please note that: Instead, all custom timeout configuration should be done by creating a `org.http4s.client.Client[F]`, using e.g. `org.http4s.client.blaze.BlazeClientBuilder[F]` and passing it to the appropriate method of the `Http4sBackend` object. -The backend supports streaming using fs2. For usage details, see the documentation on [streaming using fs2](fs2.md#streaming). +The backend supports streaming using fs2. For usage details, see the documentation on [streaming using fs2](fs2.md). The backend doesn't support [websockets](../websockets.md). diff --git a/docs/backends/summary.md b/docs/backends/summary.md index bc6503be65..247e59c977 100644 --- a/docs/backends/summary.md +++ b/docs/backends/summary.md @@ -104,12 +104,6 @@ Class Effect type Supported stream t ================================ ============================ ========================================= =================== ``` -Finally, there are third-party backends: - -* [sttp-play-ws](https://github.com/scalamania/sttp-play-ws) for "standard" play-ws (not standalone). -* [akkaMonixSttpBackend](https://github.com/fullfacing/akkaMonixSttpBackend), an Akka-based backend, but using Monix's `Task` & `Observable`. -* [be-kind-rewind](https://github.com/reibitto/be-kind-rewind), a VCR testing library for Scala - ## Backend types Depending on the capabilities that a backend supports, the exact backend type differs: diff --git a/docs/backends/wrappers/custom.md b/docs/backends/wrappers/custom.md index 85c0285817..e248a14295 100644 --- a/docs/backends/wrappers/custom.md +++ b/docs/backends/wrappers/custom.md @@ -107,7 +107,7 @@ Handling retries is a complex problem when it comes to HTTP requests. When is a * only idempotent HTTP methods (such as `GET`) could potentially be retried * some HTTP status codes might also be retryable (e.g. `500 Internal Server Error` or `503 Service Unavailable`) -In some cases it's possible to implement a generic retry mechanism; such a mechanism should take into account logging, metrics, limiting the number of retries and a backoff mechanism. These mechanisms could be quite simple, or involve e.g. retry budgets (see [Finagle's](https://twitter.github.io/finagle/guide/Clients.md#retries) documentation on retries). In sttp, it's possible to recover from errors using the `monad`. A starting point for a retrying backend could be: +In some cases it's possible to implement a generic retry mechanism; such a mechanism should take into account logging, metrics, limiting the number of retries and a backoff mechanism. These mechanisms could be quite simple, or involve e.g. retry budgets (see [Finagle's](https://twitter.github.io/finagle/guide/Clients.html#retries) documentation on retries). In sttp, it's possible to recover from errors using the `monad`. A starting point for a retrying backend could be: ```scala mdoc:compile-only import sttp.capabilities.Effect @@ -277,8 +277,6 @@ class MyCustomBackendHttpTest extends HttpTest[Future] { } ``` -You can find a more detailed example in the [sttp-vertx](https://github.com/guymers/sttp-vertx) repository. - ## Custom backend wrapper using cats When implementing a backend wrapper using cats, it might be useful to import: diff --git a/docs/backends/wrappers/logging.md b/docs/backends/wrappers/logging.md index 36c7ab61d5..cf860d66e6 100644 --- a/docs/backends/wrappers/logging.md +++ b/docs/backends/wrappers/logging.md @@ -31,7 +31,7 @@ To use the [slf4j](http://www.slf4j.org) logging backend wrapper, add the follow "com.softwaremill.sttp.client4" %% "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). +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.x/log4j-slf4j-impl.html). Example usage: diff --git a/docs/backends/wrappers/opentelemetry.md b/docs/backends/wrappers/opentelemetry.md index 82018a9c95..953900cb28 100644 --- a/docs/backends/wrappers/opentelemetry.md +++ b/docs/backends/wrappers/opentelemetry.md @@ -77,7 +77,7 @@ val tracing: Tracing = ??? OpenTelemetryTracingZioBackend(zioBackend, tracing) ``` -By default, the span is named after the HTTP method (e.g "HTTP POST") as [recommended by OpenTelemetry](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/http.md#name) for HTTP clients, +By default, the span is named after the HTTP method (e.g "HTTP POST") as [recommended by OpenTelemetry](https://opentelemetry.io/docs/specs/semconv/http/http-metrics/#http-client) for HTTP clients, and the http method, url and response status codes are set as span attributes. You can override these defaults by supplying a custom `OpenTelemetryZioTracer`. diff --git a/docs/backends/wrappers/prometheus.md b/docs/backends/wrappers/prometheus.md index 0724e98517..5286a81010 100644 --- a/docs/backends/wrappers/prometheus.md +++ b/docs/backends/wrappers/prometheus.md @@ -12,7 +12,7 @@ and some imports: import sttp.client4.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). +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/). The Prometheus backend wraps any other backend, for example: diff --git a/docs/index.md b/docs/index.md index fa260588a4..128a5fe527 100644 --- a/docs/index.md +++ b/docs/index.md @@ -48,7 +48,7 @@ sttp is a family of Scala HTTP-related projects, and currently includes: Third party projects: * [sttp-oauth2](https://github.com/ocadotechnology/sttp-oauth2): OAuth2 client library for Scala -* [sttp-openapi-generator](https://github.com/ghostbuster91/sttp-openapi-generator): Generate sttp client from openapi specification with ease! +* [sttp openai](https://github.com/softwaremill/sttp-openai): Scala client wrapper for OpenAI (and OpenAI-compatible) API. Use the power of ChatGPT inside your code! ## Try sttp client in your browser! diff --git a/docs/other.md b/docs/other.md index 5152782340..1c72ec75da 100644 --- a/docs/other.md +++ b/docs/other.md @@ -1,13 +1,9 @@ # Other Scala HTTP clients -* [scalaj](https://github.com/scalaj/scalaj-http) * [akka-http client](http://doc.akka.io/docs/akka-http/current/scala/http/client-side/index.html) -* [dispatch](http://dispatch.databinder.net/Dispatch.html) * [play ws](https://github.com/playframework/play-ws) -* [fs2-http](https://github.com/Spinoco/fs2-http) * [http4s](http://http4s.org/v0.17/client/) * [Gigahorse](http://eed3si9n.com/gigahorse/) -* [RösHTTP](https://github.com/hmil/RosHTTP) * [Requests-Scala](https://github.com/lihaoyi/requests-scala) Also, check the [comparison by Marco Firrincieli](https://github.com/mfirry/scala-http-clients) on how to implement a simple request using a number of Scala HTTP libraries. diff --git a/docs/resilience.md b/docs/resilience.md index d68e14dd7d..9ae87bb2d1 100644 --- a/docs/resilience.md +++ b/docs/resilience.md @@ -17,7 +17,7 @@ Still, the input for a particular resilience model might involve both the result Here's an incomplete list of libraries which can be used to manage retries in various Scala stacks: * for `Future`: [retry](https://github.com/softwaremill/retry) -* for ZIO: [schedules](https://zio.dev/docs/datatypes/datatypes_schedule), [rezilience](https://github.com/svroonland/rezilience) +* for ZIO: [schedules](https://zio.dev/reference/schedule/), [rezilience](https://github.com/svroonland/rezilience) * for Monix/cats-effect: [cats-retry](https://github.com/cb372/cats-retry) * for Monix: `.restart` methods diff --git a/http4s-backend/src/test/scala/sttp/client4/http4s/Http4sHttpStreamingTest.scala b/http4s-backend/src/test/scala/sttp/client4/http4s/Http4sHttpStreamingTest.scala index 7839e7f697..113653c126 100644 --- a/http4s-backend/src/test/scala/sttp/client4/http4s/Http4sHttpStreamingTest.scala +++ b/http4s-backend/src/test/scala/sttp/client4/http4s/Http4sHttpStreamingTest.scala @@ -10,7 +10,7 @@ import sttp.capabilities.fs2.Fs2Streams class Http4sHttpStreamingTest extends Fs2StreamingTest { - private val blazeClientBuilder = BlazeClientBuilder[IO](ExecutionContext.global) + private val blazeClientBuilder = BlazeClientBuilder[IO].withExecutionContext(ExecutionContext.global) override val backend: StreamBackend[IO, Fs2Streams[IO]] = Http4sBackend.usingBlazeClientBuilder(blazeClientBuilder).allocated.unsafeRunSync()._1