You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

27 lines
681 B

package nova.monadic_sfx.http.requests
import nova.monadic_sfx.AppTypes
import nova.monadic_sfx.AppTypes.HttpBackend
import monix.eval.Task
import sttp.client._
import sttp.client.circe._
import io.circe.generic.auto._
import nova.monadic_sfx.models._
class DummyRequest(backend: HttpBackend) extends AppTypes {
private implicit val _backend = backend
def send() = {
Task
.suspend(
(for {
req <-
basicRequest
.get(uri"https://httpbin.org/get")
.response(asJson[HttpBinResponse])
.send()
} yield println(req)) >>
Task(println(Thread.currentThread().getName()))
)
}
}