diff options
author | Li Haoyi <haoyi.sg@gmail.com> | 2018-07-23 21:49:11 +0800 |
---|---|---|
committer | Li Haoyi <haoyi.sg@gmail.com> | 2018-07-23 21:57:01 +0800 |
commit | 603dfa8946f8c78580568613cd268ad05c6c38f6 (patch) | |
tree | 6be83f40a79aa58517f8903e49d0d978c7372f9d /cask/test/src/test/cask | |
parent | 3fcab5dc0dc5df56976d87a7097549a55ec8e321 (diff) | |
download | cask-603dfa8946f8c78580568613cd268ad05c6c38f6.tar.gz cask-603dfa8946f8c78580568613cd268ad05c6c38f6.tar.bz2 cask-603dfa8946f8c78580568613cd268ad05c6c38f6.zip |
First pass at specializing `ParamReader` for `JsonReader` and `FormReader`
Diffstat (limited to 'cask/test/src/test/cask')
-rw-r--r-- | cask/test/src/test/cask/FormJsonPost.scala | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/cask/test/src/test/cask/FormJsonPost.scala b/cask/test/src/test/cask/FormJsonPost.scala new file mode 100644 index 0000000..2874a52 --- /dev/null +++ b/cask/test/src/test/cask/FormJsonPost.scala @@ -0,0 +1,19 @@ +package test.cask + +import cask.FormValue +import io.undertow.server.HttpServerExchange + +object FormJsonPost extends cask.MainRoutes{ + @cask.postJson("/json") + def jsonEndpoint(x: HttpServerExchange, value1: ujson.Js.Value, value2: Seq[Int]) = { + "OK " + value1 + " " + value2 + } + + @cask.postForm("/form") + def formEndpoint(x: HttpServerExchange, value1: FormValue, value2: Seq[Int]) = { + "OK " + value1 + " " + value2 + } + + initialize() +} + |