Skip to content

Instantly share code, notes, and snippets.

@Errorific
Created June 10, 2015 01:46
Show Gist options
  • Save Errorific/dfd2c2d64a94008d11ac to your computer and use it in GitHub Desktop.
Save Errorific/dfd2c2d64a94008d11ac to your computer and use it in GitHub Desktop.
package com.example.basicproject
import org.http4s.Request
import org.http4s.Method
import org.http4s.Headers
import org.http4s.Header
import org.http4s.Http4s._
import scalaz.concurrent.Task
object HelloWorld {
def main(args: Array[String]) {
while(true) {
val start = System.currentTimeMillis
println(u.run.take(100))
val finish = System.currentTimeMillis
println("time " + (finish - start))
}
}
val client = org.http4s.client.blaze.PooledHttp1Client()
val r: Request = new Request(
method = Method.GET,
uri = uri("https://api.github.com/gists/933d379288cb22d7cd03"),
headers = Headers(
Header("Content-Type", "application/json")
)
)
val u: Task[String] = client(r).as[String]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment