Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
  • 09:32

    ghostbuster91 on master

    Add websocket test for AHC futu… (compare)

  • 06:37
    user753 opened #650
  • 02:52
    ngbinh commented #619
  • 02:17
    ikhoon commented #619
  • Aug 05 19:50
    ghostbuster91 commented #190
  • Aug 05 19:48

    ghostbuster91 on migrate-okhttp

    Migrate OkHttpBackend [OkHttp] Divide base class into… (compare)

  • Aug 05 05:10
    guizmaii commented #190
  • Aug 04 14:48
    ghostbuster91 opened #649
  • Aug 04 13:16
    ghostdogpr opened #648
  • Aug 04 12:41
    scala-steward opened #647
  • Aug 03 09:15

    mergify[bot] on master

    Update jaeger-client to 1.3.2 Merge pull request #646 from sc… (compare)

  • Aug 03 09:15
    mergify[bot] closed #646
  • Aug 03 08:53
    scala-steward opened #646
  • Aug 01 15:18
    adamw assigned #611
  • Aug 01 07:37

    adamw on v3

    Extract common ws code (compare)

  • Aug 01 07:33

    adamw on v3

    Migrate ahc-zio backend (compare)

  • Jul 31 19:41

    adamw on v3

    Migrate fs2 & partly zio backend (compare)

  • Jul 31 14:50

    adamw on v3

    Migrate future & scalaz-ahc bac… (compare)

  • Jul 31 14:22

    adamw on v3

    Migrate cats-ahc backend (compare)

  • Jul 31 12:15

    adamw on v3

    Further dividing the AHC backen… (compare)

Arun Gopalpuri
Is there a way to log all request/response in sttp?
I have case class with camel case and api with snake case (classic ^^), using json4s "manually" I can see how to do it but is there any way to pass a sttp serializer / deserializer to this same end ?
4 replies
Rhys Bradbury
Is there an example usage of the SttpBackendStub with a NoContent returned in the WhenRequest#thenRespond def?
For example
SttpBackendStub(new AsyncMonadAsyncError[Task]).whenRequestMatches(_ => true).thenRespond(
  //somethign here to represent NoContent
Rhys Bradbury
do you just use ?
        code = StatusCodes.NoContent
1 reply
Rhys Bradbury
The default msg = "" is this the same as NoContent in SttpBackendStub
can anybody tell me, if I use HttpURLConnectionBackend (I just have to...), should I use only one instance per application, or I need an instance for every class that uses it?
2 replies
Hello everyone I was wondering if there is an option to configure HTTPS Proxy in the following way:
implicit val sttpBackend: SttpBackend[Identity, Nothing, WebSocketHandler] = OkHttpSyncBackend(
        options = SttpBackendOptions.httpProxy()
Hi! I'm looking into WebSocketClient options on the ScalaJS side. I was wondering whether there is any good reason not to have the ZIO backend also published for ScalaJS, since ZIO itself is already available on SJS?
1 reply
Hi. Does anyone know if STTP uses persistent connections (in order to reuse them) or it just connects once for each request? Thanks
3 replies
Hello everyone I'm getting the following error in a client where I'm sending a simple post request: any idea what it might be ?
sttp.client.SttpClientException$ReadException: Unexpected end of file from server +details
sttp.client.SttpClientException$ReadException: Unexpected end of file from server
    at sttp.client.SttpClientException$.defaultExceptionToSttpClientException(SttpClientException.scala:39)
    at sttp.client.HttpURLConnectionBackend.$anonfun$adjustExceptions$1(HttpURLConnectionBackend.scala:287)
    at sttp.client.SttpClientException$.adjustSynchronousExceptions(SttpClientException.scala:50)
    at sttp.client.HttpURLConnectionBackend.adjustExceptions(HttpURLConnectionBackend.scala:287)
    at sttp.client.HttpURLConnectionBackend.send(HttpURLConnectionBackend.scala:28)
    at sttp.client.HttpURLConnectionBackend.send(HttpURLConnectionBackend.scala:22)
    at sttp.client.FollowRedirectsBackend.sendWithCounter(FollowRedirectsBackend.scala:29)
    at sttp.client.FollowRedirectsBackend.send(FollowRedirectsBackend.scala:17)
2 replies
Nick Childers
I am a bit confused by the multipartBody documentation.. its not clear to me how to use it, or what the type parameter is supposed to be
Nick Childers
Also, the docs reference some "Multipart" class that doesnt seem to exist
Sean Kwak

I have started using Cats effect (IO). Usually effect type 'IO' is stated in the main class and each component is to have [F[_]: Sync] type signature.
When I use the following Sttp dependency, 'IO' is to be stated in a Custom HttpClient class.

I don't know how it's used in production code normally. Do people define implicit val cs: ContextShift[F] = IO.contextShift( ) in the main class and pass it in to HttpClient class? Any advice for me?

@cosmir17 You can’t define the ContextShift like that (with F in the type, but using IO). You can go with tagless final and have everything except your main class in F[_] or you use IO all the way down. In either way, use IOApp for your main class, then you get the ContextShift for free (it’s pre-defined there). Creating it yourself is usually only necessary in cases where the main isn’t yours, for example inside Play or Spark or so.
Sean Kwak
Thank you, @ybasket. If I haven't misunderstood what you said, I get 'ContextShift' from IOApp used in Main class and provide it all the way down to my Custom Http Client (sttp).
@cosmir17 Yes, exactly. Note that very often, you’ll want to initialize your sttp backend also in or close to your main class, so “all the way down” wouldn’t be too deep down
Sean Kwak
@ybasket yes, I see. I then can pass my client instance to an apporpiate logic class.
Philipp Dörfler
Hi all! I just wanna say thank you to softwaremill for making this library! I love using it in my personal projects :)
1 reply
Leo Uzcategui
Hi - I am new to sttp and I like what I've tried so far. I read the usage example for spray-json in the Docs. I am not using a case class but I would like to know how to decode the response directly into a spray.json.JsObject, without having to parse the response body from a String into a JsObject. For example something like: basicRequest.get(...).response(asJson[???]).send()
What should ??? be? I've tried JsObject and JsValue but neither one works.
Is it possible to do this? Thanks in advance
3 replies

Hello, I am trying to a simple synchronous post request using sttp and following

but i get following error:

1 reply
am i missing any arguments that i must provide? cuz the doc doesnt say so.
Nick Childers

Im still having a bit of a hard time understanding how the multipart body part of the api is supposed to be used - ive tried mapping the input to

data: Seq[RawData]


case class FormThing(file:  Part[InputStream])
data: FormThing

In both cases they compile, but the resulting object isnt exactly what i expected - fields defined in Part / RawData like contentType and headers do not appear to be set.

1 reply
Nick Childers
I think there is a bug in this chunk of code (package sttp.tapir.server.akkahttp):
private def entityToRawValue[R](
      entity: HttpEntity,
      bodyType: RawBodyType[R],
      ctx: RequestContext
      implicit mat: Materializer,
      ec: ExecutionContext
  ): Future[R] = {
    bodyType match {
      case RawBodyType.StringBody(_)   => implicitly[FromEntityUnmarshaller[String]].apply(entity)
      case RawBodyType.ByteArrayBody   => implicitly[FromEntityUnmarshaller[Array[Byte]]].apply(entity)
      case RawBodyType.ByteBufferBody  => implicitly[FromEntityUnmarshaller[ByteString]].apply(entity).map(_.asByteBuffer)
      case RawBodyType.InputStreamBody => implicitly[FromEntityUnmarshaller[Array[Byte]]].apply(entity).map(new ByteArrayInputStream(_))
      case RawBodyType.FileBody =>
          .flatMap(file => entity.dataBytes.runWith(FileIO.toPath(file.toPath)).map(_ => file))
      case m: RawBodyType.MultipartBody =>
        implicitly[FromEntityUnmarshaller[Multipart.FormData]].apply(entity).flatMap { fd =>

            .mapConcat(part => m.partType(, _)).toList)
            .mapAsync[RawPart](1) { case (part, codecMeta) => toRawPart(part, codecMeta, ctx) }
1 reply
In particular, it doesnt appear that entity.contentType is ever accessed / copied into the rawPart
compared to the akka directive fileUpload, it has this line to pull out the FileInfo metadata:
 val data = (FileInfo(, part.filename.get, part.entity.contentType), part.entity.dataBytes)
Viktor Lund
This message was deleted
This message was deleted
Anyone know if sttp supports custom uri decoding? I've got some funky url's using "__" in place of "&" for some query params, which causes sttp to significantly mutate the url when it encounters the subsequent "=".
1 reply
I'd like to be able to tell sttp to treat "__whatever=" like "&whatever="
does sttp support server sent events?
1 reply
I didn't find any docs about compression, how sttp works with it? should custom serializers / deserializers deal with it anyhow or it's abstracted away?
11 replies
Guillaume Massé
Is it possible to use cachedHostConnectionPoolHttps with the Akka backend ?
eg Flow[(HttpRequest, T), (Try[HttpResponse], T), HostConnectionPool]
Hey everyone! I have a small example project that uses sttp together with zio. I stumbled upon an error which seems to have relations to sttp's error handling. The error appears in my sample project's getContributors method. @luis3m figured out that using Throwable's getMessage with HttpError prints null. He suggested also that it would be helpful if parsing sttp's error to string includes the actual message which it does not curently. Please see
2 replies
Sebastian Voss
Hi All, I somehow cannot get tapir to produce an http4s endpoint which does Transfer-Encoding: chunked. Is this a known issue? I was unable to find more details (also filed an issue here with some sample code: softwaremill/tapir#645). Any hint is highly appreciated.
3 replies
Saskia Gennrich
I'm currently migrating a lib from sttp v1 to v2. version 1 had a parseResponseIfmethod on the request specification. I cannot find that for v2. How would I specify to parse the response even if it is a 4xx response
2 replies
Balázs Kossovics
I was wondering, in the following case, on which threads will asJson and handleDeserializationError be executed?
      .method(method, uri)
      .headers(headers: _*)
1 reply
if those operations are relatively costly because of a relatively big response payload, can that mess up the request timeouts for the rest of the requests? we are using AsyncHttpClient, and in some case the readTimeout is not respected as far as we can tell based on our monitoring
Avinder Bahra
hi - I want to get some latency metrics from STTP into DataDog - is this possible out of the box? If not our preference would be to use zio-metrics as we are using ZIO - would we have to do something like this Has anyone done something similar to this?
6 replies
Avinder Bahra
Or is the built in support for OpenTracing the way to go?
1 reply
@adamw Any chance of cutting a release for sttp-client too, now that tapir is on zio 1.0.0-RC21-2? :) (I bet ur already in the midst of doing it, haha. Thanks)
Jason Pickens
I am trying to use httpclient-backend-zio but how do I create a SttpClient? The one from HttpClientZioBackend is the wrong type.
1 reply
SttpClient is a Has[SttpBackend[BlockingTask, ZStream[Blocking, Throwable, Byte], NothingT]] but HttpClientZioBackend only gives a Has[SttpBackend[BlockingTask, ZStream[Blocking, Throwable, Byte], WebSocketHandler]]
Jason Pickens
Hmm I think that this is a regression introduced in softwaremill/sttp#603
Vitalii Supryhan
Brandon Hudgeons
I'm using the ZIO backend and trying to diagnose a memory leak. threadLocalMap of io.netty.util.concurrent.FastThreadLocalThread #3009 [Thread, Stack Local] "AsyncHttpClient-5-1" tid=196 [RUNNABLE] Native ID: 16561879 14856 384 is holding on to PoolChunks containing the byte buffers of responses. Any suggestions?
Brandon Hudgeons
ah ... it looks like just using the AsyncHttpClientZioBackend().flatMap { implicit backend => as recommended in the docs creates a client every time?
10 replies
Ibrahim Moufti

Hello everyone : )

Apologies in advance if the question does not follow guidelines as I am new here. I am also new to sttp and Monix, and I am trying to learn more about these libraries. My goal is to fetch data (client-side) from a given API via HTTP GET requests -> parse JSON responses -> write this information to a database. My question pertains to the first part only. My objective is to run get requests in an asynchronous (hopefully fast) way while having a way to either avoid or handle rate limits.

Below is a snippet of what I have already tried, and seems to work for a single request:


    import io.circe.{Decoder, HCursor}
    import sttp.client._
    import sttp.client.circe._
    import sttp.client.asynchttpclient.monix._
    import monix.eval.Task

    object SO extends App {

      case class Bla(paging: Int)

      implicit val dataDecoder: Decoder[Bla] = (hCursor: HCursor) => {
        for {
          next_page <- hCursor.downField("foo").downArray.downField("bar").as[Int]
        } yield Bla(next_page)

      val postTask = AsyncHttpClientMonixBackend().flatMap { implicit backend =>
        val r = basicRequest
          .header("accept", "application/json")
          .header("Authorization", "hushh!")

        r.send() // How can I instead of operating on a single request, operate on multiple
          .flatMap { response =>


      postTask.runSyncUnsafe() match {
        case Left(error) => println(s"Error when executing request: $error")
        case Right(data) => println(data)

My questions:

  1. How can I operate on several GET Requests (instead of a single request) while keeping the code asynchronous and composable
  2. How can I avoid or handle hitting rate-limits imposed by the api server

On a side note, I am not particularly fixated on using Monix, and I am open to any other back-end or implementation

16 replies