Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Nov 13 19:34
    Avasil opened #358
  • Nov 13 12:14
    guymers commented #356
  • Nov 12 19:46
    adamw commented #356
  • Nov 12 18:12
    scala-steward opened #357
  • Nov 11 21:30
    guymers opened #356
  • Nov 09 20:47

    adamw on master

    Docs (compare)

  • Nov 09 16:05

    softwaremill-ci on v2.0.0-RC1

    (compare)

  • Nov 09 16:05

    softwaremill-ci on master

    Setting version to 2.0.0-RC1 Setting version to 2.0.0-RC2-SN… (compare)

  • Nov 09 14:58

    adamw on master

    Update monix to 3.1.0 Merge pull request #355 from sc… (compare)

  • Nov 09 14:58
    adamw closed #355
  • Nov 08 03:41
    scala-steward opened #355
  • Nov 06 13:52
    ghostbuster91 assigned #12
  • Nov 06 07:47

    softwaremill-ci on v2.0.0-M11

    (compare)

  • Nov 06 07:47

    softwaremill-ci on master

    Setting version to 2.0.0-M11 Setting version to 2.0.0-M12-SN… (compare)

  • Nov 05 20:44

    adamw on master

    Fixing NoSuchMethodError when c… (compare)

  • Nov 05 19:16

    mergify[bot] on master

    Update fs2-core, fs2-io, ... to… Merge pull request #354 from sc… (compare)

  • Nov 05 19:16
    mergify[bot] closed #354
  • Nov 05 18:27

    softwaremill-ci on v2.0.0-M10

    (compare)

  • Nov 05 18:27
    scala-steward opened #354
  • Nov 05 17:40
    adamw commented #352
Adam Warski
@adamw
@voonchav_gitlab hm yes, I think you'll have to use the sttp version that's used in tapir, until tapir itself is updated to a newer sttp. Which isn't so easy, as that means cats 2/cats-effect 2, and that in turn means problems with http4s which isn't yet released for these versions :)
vonchav
@voonchav_gitlab
No worries. I'll wait. Thanks!
etienne
@crakjie
Hello, do the streamBody set the 'Transfer-Encoding: chunked' and add the 'terminating chunk' automaticaly ?
Adam Warski
@adamw
@crakjie that really depends on the backend, as it's the backend which does the actual streaming. Which backend are you using? However I would guess that both akka http and async http client do so.
etienne
@crakjie
@adamw Yes I look inside the backend and it seems they are well done
Daniel Sebban
@dsebban_twitter
AsyncHttpClientZioBackend().flatMap ( b => ZioWebSocketHandler(None).flatMap { h => basicRequest.get(uri"wss://echo.websocket.org").openWebsocket(h)(b,???) })
This is in v2
not sure how to fill the ???
Adam Warski
@adamw
Daniel Sebban
@dsebban_twitter
thnks ! willl look into that , awesome work btw !
Felix Palludan Hargreaves
@hejfelix
hey, whats the outlook for STTP2, any roadmap?
we are anxious to upgrade esp because of improved error handling
Adam Warski
@adamw
@hejfelix I wouldn't be brave enough to give any dates :) but all the major changes I wanted to make are there (which is quite a lot: changing that packages, response handling, adding websockets == changing backends)
one more thing that is left if the sttp-model project, which is quite poor currently, I'd like to extend it a bit
Felix Palludan Hargreaves
@hejfelix
cool, no sweat. I'm also just looking for a gut-feeling, do you feel like an RC is far away?
and would you be brave enough to say 2019 or 2020?
Adam Warski
@adamw
2019 :)
I think RC would be quite close. "Just" the model and looking through some issue on GH
Felix Palludan Hargreaves
@hejfelix
that sounds awesome! We are looking forward to it :)
Sander Dijkhuis
@sander
Hi! I can't get the http4s client backend to work. Http4sBackend.usingClient(client) returns an sttp.client.SttpBackend, but RequestT.send() requires a com.softwaremill.sttp.SttpBackend. My build.sbt:
  "com.softwaremill.sttp"        %% "core"             % "1.7.2",
  "com.softwaremill.sttp.client" %% "core"             % "2.0.0-M7",
  "com.softwaremill.sttp.client" %% "http4s-backend"   % "2.0.0-M7",
Any ideas? I'd guess I'm using the wrong versions, but these are what I found in the sttp docs.
Using sttp through Tapir v0.11.7, which seems to rely upon v1.6.7 even
Raffiki
@Raffiki
is there a TryHttpURLConnectionBackend stub instance?
Raffiki
@Raffiki
can't make one since SttpBackendStub is private
Adam Warski
@adamw
@sander I think you'll need to stick to a single major sttp version :) if you are using it through tapir, try using 1.7.2 consistently, including the http4s backend via: "com.softwaremill.sttp" %% "http4s-backend" % "1.7.2"
@Raffiki you should be able to make one using SttpBackendStub(TryHttpURLConnectionBackend()) or SttpBackendStub(TryMonad)
Sander Dijkhuis
@sander
@adamw thanks, got it. could not find http4s-backend 1.7.2 but that's because I was looking into com.softwaremill.sttp.client instead of com.softwaremill.sttp (where the older versions live)
Kirill Kushtal
@kushtal
Hello. May I ask you to correct a small mistake?
trait sttp.model.HeaderNames
val XRequestedWidth = "X-Requested-Width"
should be "X-Requested-With" (without "d")
Thank :)
Adam Warski
@adamw
@kushtal done on master, that's a weird typo :)
Kirill Kushtal
@kushtal
Hello. Please tell me how to solve this problem?
When I send a request with a custom error type (for example, IO[RequestException, String]), then I get an exception after the calling send(), because I get the result type with Throwable (instead of RequestException).
image.png
Adam Warski
@adamw
@kushtal well the send() can end up with any exception (as any exception can be thrown by async-http-client, which is the implementation of the backend)
so you'll have to somehow handle these exceptions and recover or wrap them in your exception class
Gulyás Imre Miklós
@imgulyas
Hello. We are trying to write basically a REST client on an appliance that might have multiple network interfaces. Is there a way to specify which network interface to use with sttp?
Loïc Descotte
@loicdescotte
Hi, I'm migrating from sttp 1 to sttp 2, I'm using a cats/fs2 backend
I was using AsyncHttpClientFs2Backend like this :implicit val sttpBackend = AsyncHttpClientFs2Backend[cats.effect.IO]()
now, instead of returning a backend, I have an IO[SttpBackend]
so I'm doing this :
sttpBackend.flatMap{ implicit backend =>

  // my requests stuff here

}
is it the right way to use the AsyncHttpClientFs2Backend with STTP 2?
thanks :)
Kasper Kondzielski
@ghostbuster91
The reason why the creation of AHC is wrapped with an effect( in this case IO) is because it allocates a thread poll during creation (and this is obviously a side-effect).
Therefore people how write their apps in purely functional way don't have to wrap it on their own.
If you will access the backend like that each time you send a request it will create a new thread poll each time which is very inefficient.
I think that there are two options
Either you write your app in purely functional way and you wrap this IO with the resource using Resource.make and acquire it like any other resource
or you don't care about the thread poll creation in terms of side effects, so you run this IO using unsafeRunSync to acquire sttpBackend
In each option you get an instance of sttpBackend which you can pass to other components of your application implicitly
@loicdescotte ^^
Loïc Descotte
@loicdescotte
Thanks @ghostbuster91 for the clarification!
This message was deleted
Loïc Descotte
@loicdescotte
In my case I have a single request so it does not matter but indeed it should be acceded as a single instance
Adam Warski
@adamw
hey! I published sttp-client 2.0.0-RC1 & sttp-tapir 0.12.0. This means new groupids (com.softwaremill.sttp.[client|tapir]) and packages (sttp.[client|tapir]). These are mostly mechanical changes, but there's also a couple of others which might make it necessary to change types etc. It also brings better integration between the two libraries, through a shared meta-model and improved client generation using tapir. For an overview of changes see:
William Wolf
@throughnothing
I'm running into an issue sttp (with 2.0.0-RC1) and the ZIO Async Backend for websockets. I have this code: val response: Task[WebSocketResponse[WebSocket[Task]]] = basicRequest .get(uri"wss://echo.websocket.org") .openWebsocket(ZioWebSocketHandler()
And get this error, which I can't seem to resolve: polymorphic expression cannot be instantiated to expected type; found : [F[_]]F[sttp.client.ws.WebSocketResponse[Object]] required: zio.Task[sttp.client.ws.WebSocketResponse[sttp.client.ws.WebSocket[zio.Task]]] (which expands to) zio.ZIO[Any,Throwable,sttp.client.ws.WebSocketResponse[sttp.client.ws.WebSocket[zio.Task]]]