indyaah / bee-client

bee-client

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bee-Client - A Lightweight Scala HTTP Client

  • Bee Client is a Scala API that wraps the standard java.net.URL capability for making HTTP requests more easily.
  • ...Much more easily!

It is written in Scala but may be called (a lot less easily) from Java also.

Simply create an HttpClient instance and get / post / whatever your requests.

val httpClient = new HttpClient
val response: Response = httpClient.get("http://www.google.com/")
println(response.status)
println(response.body.asString)

More examples follow in the tutorial.

Features

  • Simple to use - provides easy programmatic HTTP client calls, handling the necessary headers and body data.
  • Light-weight - not much code; doesn't get in the way.
  • Fast performance and low memory footprint.
  • Easy handling of headers - both for requests and responses; both with simple values and with complex structure.
  • Flexible and efficient handling of content (entity) bodies, along with the media type and character encoding. UTF-8 is used as the default character encoding.
  • Request entity bodies can be streamed in. Response entity bodies can be streamed out.
  • Complete implementation: all HTTP methods and headers are supported.
  • Standards-compliance builds on HttpURLConnection and in some ways improves on it.
  • HTTPS is supported (based upon javax.net.ssl.HttpsURLConnection)
  • Cookies are supported. They are held in immutable cookie jars gleaned from response headers (or created programmatically) and then sent back with subsequent requests.
  • Automatic Redirection preserves cookies (unlike using HttpURLConnection directly).
  • Full awareness of proxies.
  • Arbitrary multi-threading is possible because all shared state is held in immutable values.
  • No additional threads are imposed - you decide what you need.
  • No 'static' variables are used, so multiple configurations can co-exist within a JVM.
  • Tested against a range of servers: Apache2, Nginx, Lighttpd, Cherokee, Tomcat7.
  • The number of external dependencies is minimised (currently: slf4j, servlet-api).

Known Bugs

Future Plans

Several new features are under consideration for future versions.

See https://bitbucket.org/rickb777/bee-client/issues?status=new&status=open

More Info

Build Status

About

bee-client

License:MIT License


Languages

Language:Scala 83.1%Language:Java 12.1%Language:PHP 2.1%Language:Shell 0.9%Language:CSS 0.7%Language:C 0.6%Language:HTML 0.3%Language:C++ 0.1%Language:Makefile 0.0%