Requisição de API com OAuth usando dispatch

26 views
Skip to first unread message

Daniel Cukier

unread,
Dec 8, 2014, 11:36:51 AM12/8/14
to scal...@googlegroups.com
Estou tentando usar o dispatch para acessar a API do Rdio (http://www.rdio.com/developers) assim:

import dispatch.url
import dispatch.Http
import dispatch.Defaults.executor
import dispatch._
import com.ning.http.client.oauth.ConsumerKey
import dispatch.oauth._

val consumer = new ConsumerKey("my key", "my secret")
val params = Map("method" -> "get", "keys" -> "t12851517", "extras" -> "-*,playCount")
val request = url("http://api.rdio.com/1/").POST <@ consumer << params <:< Map("Accept" -> "application/json")
val response = Http(request OK as.String)

Parece tudo bem, mas eu recebo um erro  403.

O que estou fazendo de errado? As chaves estão corretas...

Alguém poderia me ajudar?

Abraços!

Daniel Cukier
Software Artist
Reply all
Reply to author
Forward
0 new messages