https://github.com/macchiato-framework/macchiato-http
Http request/response helpers for Macchiato.
https://github.com/macchiato-framework/macchiato-http
Last synced: 8 months ago
JSON representation
Http request/response helpers for Macchiato.
- Host: GitHub
- URL: https://github.com/macchiato-framework/macchiato-http
- Owner: macchiato-framework
- License: mit
- Created: 2018-08-08T21:01:52.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2020-04-01T20:44:54.000Z (about 6 years ago)
- Last Synced: 2025-10-14T17:52:59.525Z (8 months ago)
- Language: Clojure
- Size: 19.5 KB
- Stars: 6
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Http request/response helpers for Macchiato
See the [macchiato framework](https://github.com/macchiato-framework) for more details
[](https://clojars.org/macchiato/http)
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:
```clojure
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:
```shell
lumo -c $(clojure -Sdeps '{macchiato/http {:mvn/version "X.Y.Z"}}' -Spath)
```
```clojure
cljs.user=> (require '[macchiato.http.response :as response])
nil
cljs.user=> (response/ok {:foo "bar"})
{:status 200, :headers {}, :body {:foo "bar"}}
```