Skip to content
Playground(another site)

bynk.http.headers_wrong_type

Error An HTTP handler's headers parameter is not typed RequestHeaders.

headers is the name the router reserves for the request's headers, so a parameter called headers must be typed RequestHeaders, the read-only view with get(name), bearer() and clientIp(). Any other type has nothing to be filled from. Retype the parameter. An input of your own needs another name, and a name that is neither a path parameter nor one of the reserved ones is bynk.http.extra_param.

Example

on GET("/whoami") (headers: String) -> Effect[HttpResult[String]] by v: Visitor { … } // ✗
on GET("/whoami") (headers: RequestHeaders) -> Effect[HttpResult[String]] by v: Visitor { … } // ✓

In the Book

See also

  • The grammar rule it governs: http_handler.
  • Every code in its category, HTTP, on the diagnostic index.
  • bynk explain bynk.http.headers_wrong_type shows the same from the installed toolchain, without a network.