Getting "Cannot find HTTP header here" in play framework Scala

1.6k views Asked by At

I have the following code in my class.

def authenticateUser() = CouchbaseAction("Knr"){ implicit request =>
    var finalResult = Json.obj()

    val (username, password) = loginForm.bindFromRequest.get
}

When I ran this it gives an error:

Cannot find HTTP header here

on loginForm.bindFromRequest.get

Yesterday I tried to use Javascript routes but I have now removed everything. Before adding the Javascript routes it worked properly. What may cause the problem?

1

There are 1 answers

0
Gavin Schulz On

Does this work?

def authenticateUser() = CouchbaseAction("Knr"){ implicit request =>
    var finalResult = Json.obj()

    val (username, password) = loginForm.bindFromRequest(request).get
}

This makes the request explicit instead of implicit.