Skip to content

macchiato-framework/macchiato-http

Repository files navigation

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"}}

About

Http request/response helpers for Macchiato.

Resources

License

Stars

Watchers

Forks

Packages

No packages published