diff --git a/README.md b/README.md index 7b2b70b5d..8d811a129 100755 --- a/README.md +++ b/README.md @@ -15,6 +15,17 @@ sttp client is an open-source HTTP client for Scala, supporting various approach The library is available for Scala 2.12, 2.13 and 3. Supported platforms are the JVM (Java 11+), Scala.JS and Scala Native. +Here's a quick example of sttp client in action, runnable using [scala-cli](https://scala-cli.virtuslab.org): + +```scala +//> using dep com.softwaremill.sttp.client4::core:4.0.0-M22 + +import sttp.client4.quick.* + +@main def run(): Unit = + println(quickRequest.get(uri"http://httpbin.org/ip").send()) +``` + sttp client addresses common HTTP client use cases, such as interacting with JSON APIs (with automatic serialization of request bodies and deserialization of response bodies), uploading and downloading files, submitting form data, handling multi-part requests, and working with WebSockets. The driving principle of sttp client's design is to provide a clean, programmer-friendly API to describe HTTP requests, along with response handling. This ensures that resources, such as HTTP connections, are used safely, also in the presence of errors. @@ -23,8 +34,8 @@ sttp client integrates with a number of lower-level Scala and Java HTTP client i Additionally, sttp client seamlessly integrates with popular libraries for JSON handling (e.g., circe, uPickle, jsoniter, json4s, play-json, ZIO Json), logging, metrics, and tracing (e.g., slf4j, scribe, OpenTelemetry, Prometheus). It also supports streaming libraries (e.g., fs2, ZIO Streams, Akka Streams, Pekko Streams) and provides tools for testing HTTP interactions. -Here's a quick example of sttp client in action, runnable using [scala-cli](https://scala-cli.virtuslab.org): - +Some more features: URI interpolation, a self-managed backend, and type-safe HTTP error/success representation, are demonstrated by the below example: + ```scala //> using dep com.softwaremill.sttp.client4::core:4.0.0-M22 @@ -49,6 +60,8 @@ import sttp.client4.* println(response.body) ``` +But that's just a small glimpse of sttp client's features! For more examples, see the [usage examples](https://sttp.softwaremill.com/en/latest/examples.html). + ## Documentation sttp (v4) documentation is available at [sttp.softwaremill.com/en/latest](https://sttp.softwaremill.com/en/latest). diff --git a/docs/index.md b/docs/index.md index aeb198c9e..b9003ed52 100644 --- a/docs/index.md +++ b/docs/index.md @@ -8,14 +8,6 @@ sttp client is an open-source HTTP client for Scala, supporting various approach The library is available for Scala 2.12, 2.13 and 3. Supported platforms are the JVM (Java 11+), Scala.JS and Scala Native. -sttp client addresses common HTTP client use cases, such as interacting with JSON APIs (with automatic serialization of request bodies and deserialization of response bodies), uploading and downloading files, submitting form data, handling multi-part requests, and working with WebSockets. - -The driving principle of sttp client's design is to provide a clean, programmer-friendly API to describe HTTP requests, along with response handling. This ensures that resources, such as HTTP connections, are used safely, also in the presence of errors. - -sttp client integrates with a number of lower-level Scala and Java HTTP client implementations through backends (using Java's `HttpClient`, Akka HTTP, Pekko HTTP, http4s, OkHttp, Armeria), offering a wide range of choices when it comes to protocol support, connectivity settings and programming stack compatibility. - -Additionally, sttp client seamlessly integrates with popular libraries for JSON handling (e.g., circe, uPickle, jsoniter, json4s, play-json, ZIO Json), logging, metrics, and tracing (e.g., slf4j, scribe, OpenTelemetry, Prometheus). It also supports streaming libraries (e.g., fs2, ZIO Streams, Akka Streams, Pekko Streams) and provides tools for testing HTTP interactions. - Here's a quick example of sttp client in action, runnable using [scala-cli](https://scala-cli.virtuslab.org): ```scala @@ -27,7 +19,15 @@ import sttp.client4.quick.* println(quickRequest.get(uri"http://httpbin.org/ip").send()) ``` -And a slightly more complex one, with URI interpolation, a self-managed backend, and type-safe HTTP error/success representation: +sttp client addresses common HTTP client use cases, such as interacting with JSON APIs (with automatic serialization of request bodies and deserialization of response bodies), uploading and downloading files, submitting form data, handling multi-part requests, and working with WebSockets. + +The driving principle of sttp client's design is to provide a clean, programmer-friendly API to describe HTTP requests, along with response handling. This ensures that resources, such as HTTP connections, are used safely, also in the presence of errors. + +sttp client integrates with a number of lower-level Scala and Java HTTP client implementations through backends (using Java's `HttpClient`, Akka HTTP, Pekko HTTP, http4s, OkHttp, Armeria), offering a wide range of choices when it comes to protocol support, connectivity settings and programming stack compatibility. + +Additionally, sttp client seamlessly integrates with popular libraries for JSON handling (e.g., circe, uPickle, jsoniter, json4s, play-json, ZIO Json), logging, metrics, and tracing (e.g., slf4j, scribe, OpenTelemetry, Prometheus). It also supports streaming libraries (e.g., fs2, ZIO Streams, Akka Streams, Pekko Streams) and provides tools for testing HTTP interactions. + +Some more features: URI interpolation, a self-managed backend, and type-safe HTTP error/success representation, are demonstrated by the below example: ```scala //> using dep com.softwaremill.sttp.client4::core:@VERSION@