/agatetepe

Yet another simple HTTP Client for Scala

Primary LanguageScalaDo What The F*ck You Want To Public LicenseWTFPL

Build Status codecov.io Maven Central

Aga-te-te-pe

(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.

What is?

A simple wrapper over java.net.HttpURLConnection using scala.concurrent.Futures

How it works ?

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)

}

External stuff

http://jsonplaceholder.typicode.com/