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

4 years ago
  1. package nova.monadic_sfx.http.requests
  2. import nova.monadic_sfx.AppTypes
  3. import nova.monadic_sfx.AppTypes.HttpBackend
  4. import monix.eval.Task
  5. import sttp.client._
  6. import sttp.client.circe._
  7. import io.circe.generic.auto._
  8. import nova.monadic_sfx.models._
  9. class DummyRequest(backend: HttpBackend) extends AppTypes {
  10. private implicit val _backend = backend
  11. def send() = {
  12. Task
  13. .suspend(
  14. (for {
  15. req <-
  16. basicRequest
  17. .get(uri"https://httpbin.org/get")
  18. .response(asJson[HttpBinResponse])
  19. .send()
  20. } yield println(req)) >>
  21. Task(println(Thread.currentThread().getName()))
  22. )
  23. }
  24. }