Open jkugiya opened 6 years ago
Pasting the following code will cause the same problem.
scala> :paste
// Entering paste mode (ctrl-D to finish)
val http = Gigahorse.http(Gigahorse.config)
val r = Gigahorse.url("http://api.duckduckgo.com").get.
addQueryString(
"q" -> "1 + 1",
"format" -> "json"
)
val f = http.run(r, Gigahorse.asString andThen {_.take(60)})
Await.result(f, 5.seconds)
However, if you execute it sequentially, the problem will not occur.
scala> val http = Gigahorse.http(Gigahorse.config)
http: gigahorse.HttpClient = gigahorse.support.okhttp.OkhClient@1cc0b3c8
scala> val r = Gigahorse.url("http://api.duckduckgo.com").get.
| addQueryString(
| "q" -> "1 + 1",
| "format" -> "json"
| )
r: gigahorse.Request = Request(http://api.duckduckgo.com, GET, EmptyBody(), Map(), Map(q -> List(1 + 1), format -> List(json)), None, None, None, None, None, None)
scala> val f = http.run(r, Gigahorse.asString andThen {_.take(60)})
f: scala.concurrent.Future[String] = Future(<not completed>)
scala> Await.result(f, 5.seconds)
res21: String = {"Definition":"","AbstractText":"","Answer":{"templates":{"o
I tried example code in Quick Start with sbt console, but NoClassDefFoundError was thrown.
OS: Windows 10 sbt: 1.0.4
However, when executing from the main, there was no problem.