Skip to content

Commit 6b58498

Browse files
committed
re-order FormJsonPost
1 parent 464375c commit 6b58498

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

example/formJsonPost/app/src/FormJsonPost.scala

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,6 @@ object FormJsonPost extends cask.MainRoutes{
1313
)
1414
}
1515

16-
@cask.postJsonCached("/json-obj-cached")
17-
def jsonEndpointObjCached(value1: ujson.Value, value2: Seq[Int], request: cask.Request) = {
18-
ujson.Obj(
19-
"value1" -> value1,
20-
"value2" -> value2,
21-
// `postJsonCached` buffers up the body of the request in memory before parsing,
22-
// giving you access to the request body data if you want to use it yourself
23-
"body" -> request.text()
24-
)
25-
}
26-
2716
@cask.postForm("/form")
2817
def formEndpoint(value1: cask.FormValue, value2: Seq[Int]) = {
2918
"OK " + value1 + " " + value2
@@ -51,6 +40,17 @@ object FormJsonPost extends cask.MainRoutes{
5140
"OK " + value1 + " " + value2 + " " + params.value + " " + segments.value
5241
}
5342

43+
@cask.postJsonCached("/json-obj-cached")
44+
def jsonEndpointObjCached(value1: ujson.Value, value2: Seq[Int], request: cask.Request) = {
45+
ujson.Obj(
46+
"value1" -> value1,
47+
"value2" -> value2,
48+
// `postJsonCached` buffers up the body of the request in memory before parsing,
49+
// giving you access to the request body data if you want to use it yourself
50+
"body" -> request.text()
51+
)
52+
}
53+
5454
@cask.postForm("/form-extra")
5555
def formEndpointExtra(value1: cask.FormValue,
5656
value2: Seq[Int],

0 commit comments

Comments
 (0)