databinder-disTOP0.8.3 Im试图从302个http://github.com/n8han/Databinder-Dispad”的回复中接回旋,但我有以下例外:
Caused by: dispatch.StatusCode: Unexpected response code: 302
http://sourced.implicit.ly/net.databinder/dissign-http/0.8.3/ConfiguredHttpClient.scala.html
import dispatch._
import org.apache.http.{HttpRequest,HttpResponse}
import org.apache.http.protocol.HttpContext
import org.apache.http.HttpStatus._
val http = new Http {
override def make_client = {
val client = new ConfiguredHttpClient(new Http.CurrentCredentials(None))
client.setRedirectStrategy(new org.apache.http.impl.client.DefaultRedirectStrategy {
override def isRedirected(req: HttpRequest, res: HttpResponse, ctx: HttpContext) = false
})
client
}
}
val req: Request = :/("graph.facebook.com") / "kmels" / "picture"
val pictureURL: String = http(req.secure >:> { _("Location").head }) //error prone code, but we re just testing. This is the line where the exception is thrown.
我失踪了什么? 一如既往,预先感谢。