helper classes for scala

My first opensource scala package

So I've released my helpers code via github. Scaladoc is available here, although I warn you that my patience with hacking the stylesheet only goes so far and I don't yet know how to make scaladoc that is not foul to look at. To build it, and run the tests, do...

mvn test

...after unpacking the tarball somewhere

The motivation behind this package is that I wanted to do some http stuff and wanted to make my client code be as simple as possible while still being polite to servers. So that meant supporting conditional get using Etags, Last-Modified and also supporting gzip encoding. I do all this by using the apache commons httpclient-4.x and httpcore-4.x libraries and wrapping them all up in a class that's convenient and simple to use. Here's a taster:

 import com.uncarved.helpers.http._

 val helper = new BasicClient()
 //Get a webpage as a string (if you look at the apache http log4j messages you can see it
 //does conditional get and has transparent gzip support)
 val str = helper.get("")

 //Get some XML (with request parameters supplied)
 val params = List(("tag"->""), ("limit"->"5"))
 val xml = helper.getXML(Request(RequestType.GET, "", params))
 val items = xml \\ "item"

Unless otherwise specified the contents of this page are copyright © 2015 Sean Hunter. This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.