Skip to content

Commit

Permalink
Fix broken links in docs (#2180)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pask423 committed May 13, 2024
1 parent 32f3d39 commit 12269ce
Show file tree
Hide file tree
Showing 11 changed files with 8 additions and 21 deletions.
1 change: 0 additions & 1 deletion docs/backends/finagle.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
2 changes: 1 addition & 1 deletion docs/backends/http4s.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
6 changes: 0 additions & 6 deletions docs/backends/summary.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 1 addition & 3 deletions docs/backends/wrappers/custom.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion docs/backends/wrappers/logging.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
2 changes: 1 addition & 1 deletion docs/backends/wrappers/opentelemetry.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.

Expand Down
2 changes: 1 addition & 1 deletion docs/backends/wrappers/prometheus.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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!

Expand Down
4 changes: 0 additions & 4 deletions docs/other.md
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 1 addition & 1 deletion docs/resilience.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 12269ce

Please sign in to comment.