Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix broken links in docs #2180

Merged
merged 2 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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](https://sttp.softwaremill.com/en/latest/backends/fs2.html#streaming).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe let's just keep a link to fs2.md to avoid hard-coding links to our own docs


The backend doesn't support [websockets](../websockets.md).
2 changes: 1 addition & 1 deletion docs/backends/summary.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ Class Effect type Supported stream t
``CurlBackend`` None (``Identity``) n/a no
================================ ============================ ========================================= ===================
```

[//]: # (TO REVIEWER all of them updated from 2 to 4 years ago)
Finally, there are third-party backends:

* [sttp-play-ws](https://github.com/scalamania/sttp-play-ws) for "standard" play-ws (not standalone).
Expand Down
3 changes: 2 additions & 1 deletion 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,6 +277,7 @@ class MyCustomBackendHttpTest extends HttpTest[Future] {
}
```

[//]: # (TO REVIEWER last update 6 years ago maybe we have sth newer)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's just remove it then

You can find a more detailed example in the [sttp-vertx](https://github.com/guymers/sttp-vertx) repository.

## Custom backend wrapper using cats
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
3 changes: 3 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ 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

[//]: # (* TO REVIEWER repo archived by owner)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's remove this then

* [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
Loading