A simple asynchronous Ajax client for ClojureScript and Clojure with a unified API across both platforms.
cljs-ajax is a simple, asynchronous HTTP client library for ClojureScript and Clojure. It provides a unified API for making GET, POST, PUT, and other HTTP requests, abstracting away the differences between browser-based XMLHttpRequest and JVM-based async HTTP clients. It solves the problem of writing network code that works consistently across both platforms without needing separate implementations.
Clojure and ClojureScript developers building web applications or full-stack projects who need a reliable, consistent way to handle HTTP requests in both frontend and backend code.
Developers choose cljs-ajax for its dead-simple API, cross-platform consistency, and support for multiple data formats like Transit and JSON. Its lightweight design and focus on doing one thing well make it a preferred alternative to more complex or platform-specific HTTP libraries.
simple asynchronous Ajax client for ClojureScript and Clojure
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Provides the same function signatures for both ClojureScript and Clojure, abstracting away platform-specific details like goog.net.XhrIo in browsers and Apache HttpAsyncClient on the JVM, reducing context switching.
Supports multiple serialization formats including Transit, JSON, text, and raw, with automatic Content-Type header handling based on the format, simplifying client-server communication.
Allows configurable success, error, progress, and finalization callbacks, with global default handlers for consistent error logging and detailed error response maps (e.g., :status, :failure keys).
Offers the ajax-request function for custom formats and smaller compiled code with advanced optimizations, plus interceptors for request/response middleware, giving developers fine-grained control.
File upload support via js/FormData is not available before IE10, and progress handlers only work with the goog.net.XhrIo API, not with raw XMLHttpRequest, restricting modern browser features.
Lacks built-in support for contemporary networking needs like WebSockets, GraphQL, or HTTP/2, focusing solely on traditional Ajax requests, which may require additional libraries.
While basic usage is covered, complex scenarios such as custom interceptors or format handling are minimally documented, often relying on community contributions or source code diving.