Here are the scenarios you might come across where you may need to troubleshoot:
Coming across an error during compilation: you cannot find any HTTP request header here.
You get this error even after you have defined the Action using a
RequestHeader
.Most of the methods used in Play that deal with requests, expect an implicit
RequestHeader
. This convention has been followed in order to keep the code simple. For example, let's look at the controller trait here:trait Controller extends Results with BodyParsers with HttpProtocol with Status with HeaderNames with ContentTypes with RequestExtractors with Rendering { //Provides an empty `Action` implementation: the result is a standard 'Not implemented yet' result page. val TODO = Action { NotImplemented[play.api.templates.Html](views.html.defaultpages.todo()) } //Retrieves the session implicitly from the request. implicit def session(implicit request: RequestHeader) = request.session //Retrieve the flash...