This avoids some odd order-of-execution bug in recent Clojure 1.2 builds, at the cost of backwards compatibility. Sorry.
This change makes it possible to write entity-as methods for services which return, e.g., XML on success, but plain text (or HTML) on failure. No more exceptions thrown before you get to check the status code.
Because the underlying HttpComponents method for applying things like pre-emptive Basic Auth is very complex, and seems to change between point releases, I've tried to capture a staged approach to applying the necessary method calls to the request, context, and other objects involved in the interaction. The first such `filter` is preemptive-basic-auth-filter, which -- as the name suggests -- instructs the library to send HTTP Basic Auth information unprompted, which can save a redundant request-response cycle. Simply call with: (http/post my-url :filters [(http/preemptive-basic-auth-filter "user:pass")]) Why didn't I add this as some kind of :auth keyword argument? Well, that's probably best saved for non-preemptive auth. This approach also extends neatly to other auth mechanisms and other request modification pipelines.
…he behavior of client applications in some circumstances.