Doing HTTP request in Scala

前端 未结 9 752
死守一世寂寞
死守一世寂寞 2020-12-12 14:31

I am trying to issue a simple POST request to a webservice which returns some XML in Scala.

It seems that Dispatch is the standard library used for this task, but I

9条回答
  •  旧巷少年郎
    2020-12-12 14:51

    I'm using dispatch: http://dispatch.databinder.net/Dispatch.html

    They've just released a new version (0.9.0) with a complete new api that I really like. And it is async.

    Example from project page:

    import dispatch._
    val svc = url("http://api.hostip.info/country.php")
    val country = Http(svc OK as.String)
    
    for (c <- country)
      println(c)
    

    edit: This might help you https://github.com/dispatch/reboot/blob/master/core/src/main/scala/requests.scala

提交回复
热议问题