Liking cljdoc? Tell your friends :D

Http request/response helpers for Macchiato

See the macchiato framework for more details

Clojars Project

This project's goal is to provide the request/response constructors in a standalone library. No middleware is included here, only pure functions.

In its very first iteration this code is just what macchiato.util in Macchiato Core is/used to be.

Examples

In a ClojureScript REPL, try:

cljs.user=> (require '[macchiato.http.request :as request])
nil
cljs.user=> (request/request-url {:scheme       :http
                                  :uri          "/foo/bar"
                                 :headers      {"host" "example.com"}
                                 :query-string "x=y"})
"http://example.com/foo/bar?x=y"

While if you are using lumo makes sure the dependency is on your classpath, then try:

lumo -c $(clojure -Sdeps '{macchiato/http {:mvn/version "X.Y.Z"}}' -Spath)
cljs.user=> (require '[macchiato.http.response :as response])
nil
cljs.user=> (response/ok {:foo "bar"})
{:status 200, :headers {}, :body {:foo "bar"}}

Can you improve this documentation?Edit on GitHub

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close