I wrote this simple scala code using http4s library

import org.http4s.client.blaze._ object ScalaHttpTest extends App { val c = PooledHttp1Client() val rTask = c.expect[String]("""http://localhost:50070/webhdfs/v1/user/?op=LISTSTATUS""") val x = rTask.attemptRun.toEither if (x.isRight) println(x.right) if (x.isLeft) println(x.left) c.shutdownNow() }

If I copy paste my URL in chrome, postman, curl it works perfectly and it shows the output

HTTP/1.1 200 OK Cache-Control: no-cache Expires: Sun, 11 Sep 2016 04:11:26 GMT Date: Sun, 11 Sep 2016 04:11:26 GMT Pragma: no-cache Expires: Sun, 11 Sep 2016 04:11:26 GMT Date: Sun, 11 Sep 2016 04:11:26 GMT Pragma: no-cache Content-Type: application/json Transfer-Encoding: chunked Server: Jetty(6.1.26.cloudera.4) {"FileStatuses":{"FileStatus":[ ]}}

here is a screenshot from chrome

But my code throws error message