https://github.com/netpyoung/cljpyoung.http.status
📡 HTTP Statuses with cljc
https://github.com/netpyoung/cljpyoung.http.status
cljc clojure http-status-code
Last synced: 9 months ago
JSON representation
📡 HTTP Statuses with cljc
- Host: GitHub
- URL: https://github.com/netpyoung/cljpyoung.http.status
- Owner: netpyoung
- License: epl-1.0
- Created: 2018-10-23T13:13:06.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-11-11T18:22:34.000Z (about 7 years ago)
- Last Synced: 2025-02-13T21:43:56.669Z (11 months ago)
- Topics: cljc, clojure, http-status-code
- Language: Clojure
- Homepage:
- Size: 31.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# http-response
[](https://clojars.org/netpyoung/cljpyoung.http.status)
* HTTP Statuses with `cljc`
* There are some other librarys. But I just want to focus on http status itself.
## Usage
``` clojure
(ns cljpyoung.http.status-test
(:require [clojure.test :refer :all])
(:require [clojure.spec.alpha :as s])
(:require [cljpyoung.http.status :as status]))
(deftest for-readme
(testing "status"
(is (= 200 status/OK)))
(testing "spec"
(is (s/valid? ::status/unassigned 999))
(is (s/valid? ::status/success status/OK))
(is (s/valid? ::status/success status/CREATED)))
(testing "predicate"
(is (status/ok? status/OK)))
(testing "helper"
(is (= #'http.status/CREATED
(status/status status/CREATED)))
(is (= "Created"
(status/name status/CREATED)))
(is (= "The request has been fulfilled and resulted in a new resource being created."
(status/doc status/CREATED)))))
```
## Ref:
* https://github.com/metosin/ring-http-response
* https://github.com/macchiato-framework/macchiato-http
* https://en.wikipedia.org/wiki/List_of_HTTP_status_codes
* https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml
## License
Copyright © 2018 netpyoung
Distributed under the Eclipse Public License either version 1.0 or (at
your option) any later version.