Question

I'm trying to use dispatch with a 3rd party website that has an OAuth authentication, but I'm having trouble importing things from dispatch. Consumer api it is clearly there in the library, but for some reason it is not found. I'm using sbt to build the project, here is the dependency:

libraryDependencies += "net.databinder.dispatch" %% "dispatch-core" % "0.10.0"

And below is what running repl(sbt, console-quick) gives out. Trying to compile the project ends in similar value not found errors. The import doesn't fail, but Consumer isn't available. Other things from dispatch like Http are available just fine.

scala> import dispatch._  
import dispatch._      

scala> val x = Consumer("asdasdasd", "asdasdasdasad")  
console:10:
error: not found: value Consumer     
       val x = Consumer("asdasdasd", "asdasdasdasad")  
               ^  

scala> val y = new Http  
y: dispatch.Http = Http(com.ning.http.client.AsyncHttpClient@1611cf2)

It seems someone else has had problems with this as well, but no answers.. https://groups.google.com/forum/?fromgroups=#!topic/liftweb/NI3nZJjsrjo

The closes thing I've found is SomeConsumer in the dispatch.oauth package, but it isn't what I'm looking for. Here you can see Consumer and Token in the package, but

import dispatch.oauth._

Doesn't help.

Was it helpful?

Solution

The api is for 0.8 version.

If you read the documentation you use the reboot repository which is a complete rewrite of the dispatch using the async-http-client.

For an example usage you can see the following code on gitub and the following

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top