1
Scala Dispatch로 간단한 GET 요청을 실행하려고하는데 404 오류로 오류가 발생했습니다. 예기치 않은 응답 상태 : 여기에 404Scala Dispatch Simple Get 요청
가 작동하는 예입니다
https://www.google.com/finance/info?infotype=infoquoteall&q=tsla,goog
을하지만 amunsure 내 오류 내 코드에
import dispatch._ , Defaults._
object Main extends App {
//concats a the proper uri together to send to google finance
def composeUri (l:List[String]) = {
def google = host("google.com").secure
def googleFinance = google/"finance"/"info"
def googleFinanceGet = googleFinance.GET
val csv = l mkString ","
googleFinanceGet <<? Map("infotype"-> "infoquoteall", "q"->csv)
}
def sendRequest (uri:Req) = {
val res:Future[Either[Throwable,String]] = Http(uri OK as.String).either
res
}
val future = sendRequest(composeUri(List("tsla","goog")))
for (f <- future.left) yield println("There was an error" + f.getMessage)
}
감사되는 위치이다!
또한 완료시이 스크립트가 sbt에서 나오지 않는 이유는 무엇입니까? –