Skip to content

Commit

Permalink
re-order FormJsonPost
Browse files Browse the repository at this point in the history
  • Loading branch information
lihaoyi committed May 18, 2024
1 parent 464375c commit 6b58498
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions example/formJsonPost/app/src/FormJsonPost.scala
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,6 @@ object FormJsonPost extends cask.MainRoutes{
)
}

@cask.postJsonCached("/json-obj-cached")
def jsonEndpointObjCached(value1: ujson.Value, value2: Seq[Int], request: cask.Request) = {
ujson.Obj(
"value1" -> value1,
"value2" -> value2,
// `postJsonCached` buffers up the body of the request in memory before parsing,
// giving you access to the request body data if you want to use it yourself
"body" -> request.text()
)
}

@cask.postForm("/form")
def formEndpoint(value1: cask.FormValue, value2: Seq[Int]) = {
"OK " + value1 + " " + value2
Expand Down Expand Up @@ -51,6 +40,17 @@ object FormJsonPost extends cask.MainRoutes{
"OK " + value1 + " " + value2 + " " + params.value + " " + segments.value
}

@cask.postJsonCached("/json-obj-cached")
def jsonEndpointObjCached(value1: ujson.Value, value2: Seq[Int], request: cask.Request) = {
ujson.Obj(
"value1" -> value1,
"value2" -> value2,
// `postJsonCached` buffers up the body of the request in memory before parsing,
// giving you access to the request body data if you want to use it yourself
"body" -> request.text()
)
}

@cask.postForm("/form-extra")
def formEndpointExtra(value1: cask.FormValue,
value2: Seq[Int],
Expand Down

0 comments on commit 6b58498

Please sign in to comment.