From 85e982a6bf9bd82524baf53546b31d85b426fa62 Mon Sep 17 00:00:00 2001 From: Li Haoyi Date: Sat, 14 Sep 2019 18:34:57 +0800 Subject: `InnerResponse` is now a type param instead of member, allowing better error messages through `cask.internal.Conversion`: ``` Cannot return java.io.ByteArrayInputStream as a cask.model.Response[cask.endpoints.JsonData] ``` --- docs/pages/1 - Cask: a Scala HTTP micro-framework.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'docs') diff --git a/docs/pages/1 - Cask: a Scala HTTP micro-framework.md b/docs/pages/1 - Cask: a Scala HTTP micro-framework.md index 093c8c3..52653d2 100644 --- a/docs/pages/1 - Cask: a Scala HTTP micro-framework.md +++ b/docs/pages/1 - Cask: a Scala HTTP micro-framework.md @@ -162,13 +162,13 @@ what to do in each case. You can use the `@cask.route` annotation to do so $$$formJsonPost If you need to handle a JSON-encoded POST request, you can use the -`@cask.postJson` decorator. This assumes the posted request body is a JSON dict, -and uses its keys to populate the endpoint's parameters, either as raw -`ujson.Js.Value`s or deserialized into `Seq[Int]`s or other things. -Deserialization is handled using the -[uPickle](https://github.com/lihaoyi/upickle) JSON library, though you could -write your own version of `postJson` to work with any other JSON library of your -choice. +`@cask.postJson` decorator. This assumes the posted request body is a +JSON dict, and uses its keys to populate the endpoint's parameters, +either as raw `ujson.Value`s or deserialized into `Seq[Int]`s or other +things. Deserialization is handled using the +[uPickle](https://github.com/lihaoyi/upickle) JSON library, though you +could write your own version of `postJson` to work with any other JSON +library of your choice. Similarly, you can mark endpoints as `@cask.postForm`, in which case the endpoints params will be taken from the form-encoded POST body either raw (as -- cgit v1.2.3