Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

could not import AsyncHttpClientScalazBackend #80

Closed
prayagupa opened this issue Apr 22, 2018 · 2 comments
Closed

could not import AsyncHttpClientScalazBackend #80

prayagupa opened this issue Apr 22, 2018 · 2 comments

Comments

@prayagupa
Copy link

I'm trying to use scalaz backend for my sttp but could not find one. Here's my sbt

name := "customer-order-specs"

version := "0.1"

scalaVersion := "2.12.5"

libraryDependencies += "com.softwaremill.sttp" %% "core" % "1.1.12"
libraryDependencies += "com.softwaremill.sttp" %% "async-http-client-backend" % "1.1.12"

libraryDependencies += "com.softwaremill.sttp" %% "async-http-client-handler-scalaz" % "0.0.13"

libraryDependencies += "org.scalatest" %% "scalatest" % "3.2.0-SNAP10" % Test

libraryDependencies += "org.scalacheck" %% "scalacheck" % "1.13.4" % "test"

I do not see ScalazBackend in async-http-client-handler-scalaz.jar.

screen shot 2018-04-21 at 6 47 06 pm

I'm trying to simple scalaz backed http client example, as described in README with HttpURLConnectionBackend

  test("scalaz example") {
    import com.softwaremill.sttp.asynchttpclient.scalaz._

    implicit val backend: SttpBackend[Id, Nothing] = AsyncHttpClientScalazBackend()
    val httpRequest = sttp
      .post(uri"http://httpbin.org/post")
      .body("Hello, world!")

    val httpResponse = httpRequest.send()

    httpResponse.body.isRight shouldBe true
  }
@prayagupa
Copy link
Author

prayagupa commented Apr 22, 2018

Nevermind, I needed async-http-client-backend-scalaz which I could not find in the README at all but somehow mentioned in https://softwaremill.com/introducing-sttp-the-scala-http-client/

libraryDependencies += "com.softwaremill.sttp" %% "async-http-client-backend-scalaz" % "1.1.12"

Also the blog - https://softwaremill.com/introducing-sttp-the-scala-http-client/ probably needs to be updated.

from

implicit val backend = HttpURLConnectionSttpBackend()

to

implicit val backend = HttpURLConnectionBackend()

@adamw
Copy link
Member

adamw commented Apr 22, 2018

Ah, it's currently listed on http://sttp.readthedocs.io/en/latest/backends/asynchttpclient.html, but maybe it's not that obvious. Where did you look? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants