Skip to content
Playground(another site)

bynk.http.form_on_bodyless

Error A @form or @multipart annotation is placed on a handler that takes no body.

@form and @multipart read a form post from the request's body, so they belong on a POST, PUT or PATCH route with a body parameter. On a GET, a DELETE or a route with no body there is nothing to decode. Add a body record, or drop the annotation. @raw has the same rule: bynk.http.raw_on_bodyless.

Example

type Signup = { email: String }
@form // ✗ the route takes no body
on POST("/signup") () -> Effect[HttpResult[String]] by v: Visitor { … }
@form
on POST("/signup") (body: Signup) -> Effect[HttpResult[String]] by v: Visitor { … } // ✓

In the Book

See also

  • Every code in its category, HTTP, on the diagnostic index.
  • bynk explain bynk.http.form_on_bodyless shows the same from the installed toolchain, without a network.