Skip to content

annotation Athena::Framework::Annotations::RequestParam #

Represents a form data request parameter.

See ATHA::QueryParam for configuration options/arguments.

Warning

The entire request body is consumed to parse the form data.

require "athena"

class ExampleController < ATH::Controller
  @[ARTA::Post(path: "/login")]
  @[ATHA::RequestParam("username")]
  @[ATHA::RequestParam("password")]
  def login(username : String, password : String) : Nil
    # ...
  end
end

ATH.run

# POST /login, body: "username=George&password=abc123"