(portuguese pronunciation for HTTP)
Yet another http client for Scala.
Disclaimer: if you're looking for something more robust (and reliable), pay a visit to the akka-http library or read this blog post.
A simple wrapper over java.net.HttpURLConnection
using scala.concurrent.Future
s
import agatetepe.Entity.{Request, Response}
import Request._
import scala.concurrent._
import scala.concurrent.duration._
object HelloWorld extends App {
import scala.concurrent.ExecutionContext.Implicits.global
val client = HttpClient()
val url = "http://jsonplaceholder.typicode.com/posts/1"
val request = get(url)
val future = client.asyncProcess(request)
val result: Response = Await.result(future, 1.minutes)
println(result)
}