https://github.com/hellerve/simplereq
A native extension for zepto that empowers you to make requests easily
https://github.com/hellerve/simplereq
Last synced: 12 months ago
JSON representation
A native extension for zepto that empowers you to make requests easily
- Host: GitHub
- URL: https://github.com/hellerve/simplereq
- Owner: hellerve
- Created: 2016-09-05T11:44:14.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-09-19T15:43:13.000Z (over 9 years ago)
- Last Synced: 2025-02-12T05:12:00.979Z (about 1 year ago)
- Language: Haskell
- Size: 5.86 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# simplereq
A zepto native extension that wraps the Haskell `wreq` package
to make simple http and https requests. It is in alpha.
## Installation
```
zeps install hellerve/simplereq
```
## Usage
simplereq exposes the REST verbs and a generic verb function.
You can see it in action below:
```clojure
(load "simplereq/simplereq")
(import-all "simplereq")
(simplereq:get "https://httpbin.org/get")
(simplereq:post "https://httpbin.org/post" "hi httpbin")
(simplereq:put "https://httpbin.org/put" "hi httpbin")
(simplereq:delete "https://httpbin.org/delete")
(simplereq:request "patch" "https://httpbin.org/patch" "hi httpbin")
```
All of these methods return hashmaps with the keys `:status`, `:headers` and
`:body`.
Sadly, you can not yet mess with the request headers or cookies.
Have fun!