Friday, June 17, 2011

http.async.client v0.3.0

http.async.client v0.3.0 intorduces few changes.


Explicit client usage

As it turned out, having implicit client management and default client started by itself, was not the smartest thing to do.

Since I have very little respect for code that is wrong, I've changed it.

Now client has to be managed explicitly, meaning you have to create and close it yourself.

All methods that issue requests now expect client as first argument.


This breaks API compatibility with anything prior to v0.3.0.

I repeat: you will have to create and close client yourself.

with-client is gone

with-client macro is gone now. It might have been useful with implicit client management, but with explicit situation it would be just a copy of with-open.

Please use with-open in connection with create-client.

Migration path from:


To:

Preemptive authentication

Thanks to xeqi for patch that provides means of controlling preemptive authentication both per request and global.

Clojure 1.2.1 support

Fixed cyclic dependency in http.async.client that was not reported in 1.2.0 but prevented you from been able to load it 1.2.1.

async-http-client v1.6.3

Underlying async-http-client library version has been upgraded to 1.6.3.

Thursday, March 31, 2011

Announcing status-codes

Announcing status-codes

status-codes is easy response status codes

It's easy status codes for compojure.
Not that status codes in compojure are particularly hard.
I just prefer in applications that I work with to use keywords for
status codes, rather than status codes as numbers.

(routes
(GET "/ok" _ :ok)
(GET "/accepted" _ :accepted)
(GET "/ok-map" _ {:status :ok})
(GET "/accepted-map" _ {:status :accepted}))

Not much really, but it reads better than 200, 202 and so on.
In order to have this sugar in your routes pick status-codes from
clojars, and require/use status-codes:

(ns your.ns
(:use status-codes))

Enjoy.