Skip to content
Playground(another site)

bynk.http.limit_on_non_multipart

Error A @limit maxFile or maxParts is placed on a route that is not @multipart.

maxFile and maxParts cap the parts of a multipart body: the size of one file and the number of parts. A route that is not @multipart has no parts, so naming either in @limit is refused. Remove the argument and keep maxBody, which caps any body, or mark the route @multipart if it takes an upload. A @limit on a route with no body at all is bynk.http.limit_on_bodyless.

Example

type Signup = { email: String }
@form
@limit(maxBody: 100_000, maxFile: 10_000) // ✗ a form has no file parts
on POST("/signup") (body: Signup) -> Effect[HttpResult[String]] by v: Visitor { … }
@form
@limit(maxBody: 100_000) // ✓
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.limit_on_non_multipart shows the same from the installed toolchain, without a network.