I am trying a simple example where I am using a modification of the Dispatch example from the Scalatra site to make an async http request. The code is below. I get a compilation error that says value OK is not a member of String. I put together a standalone scala test with no Scalatra dependencies and it works as expected. I suspect OK is being pulled in from some Scalatra dependency. I am new to Scala and I am putting together a test web app using Scalatra. Any help will be appreciated.
import dispatch._
trait AppAPIStack extends AppStack {
before() {
contentType = "application/json"
}
object MyAsyncClient {
def sendReq(phrase: param): Future[String] = {
val searchURL = url("https://www.google.com/#q="+phrase)
val result = dispatch.Http(searchURL OK as.String)
for(r <- result) yield r
}
}
}