micro-middleware
文件大小: unknow
源码售价: 5 个金币 积分规则     积分充值
资源说明:Collection of simple clojure ring middlewares
micro-middleware
================

Collection of small middlewares.

## wrap-json-params

Parses request body as JSON if content type is 'application/json'.
If `:hyphenize` is `true`, will replace underscores with hyphens in keys. Default is false.
Will decompress body before parsing if 'Content-Encoding' is 'gzip'.

```clojure
(-> routes
    ...; other middlewares
    (wrap-json-params :hyphenize true))
```

See tests for more examples

## wrap-json-response

Converts body (array or hashmap) to JSON string if client accepts json.
If `:dehyphenize` is `true`, will replace hyphens with underscores in keys. Default is false.
Has custom formatter for joda time.

```clojure
(-> routes
    ...; other middlewares
    (wrap-json-response :dehyphenize true))
```

See tests for more examples

##

本源码包内暂不包含可直接显示的源代码文件,请下载源码包。