While Apache HttpClientwill work, using it from Scala is uniomatic and verbose, and the Dispatch library provides a nice Scala wrapper that allows you to write much more concise code. You can use it as follows:
import dispatch._
val u = url("https://site.com/logowanie.php")
val info = Seq("username" -> "me", "password" -> "secret")
val client = new Http
client(u << info >>> System.out)
, , client , .
, , :
import dispatch._
import dispatch.jsoup.JSoupHttp._
val u = url("https://myuni.edu/something/login")
val info = Seq(
"username" -> "me",
"password" -> "secret",
"warn" -> "true",
"submit" -> "LOGIN",
"execution" -> "e1s1",
"_eventId" -> "submit"
)
val client = new Http
val id = client(u </> (_.select("input[name=lt]").first.attr("value")))
client(u << info :+ ("lt" -> id) >>> System.out)
Dispatch JSoup , , .