Shrikant Jadhav
Shrikant Jadhav

Reputation: 176

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

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?

Upvotes: 1

Views: 1656

Answers (1)

Gavin Schulz
Gavin Schulz

Reputation: 4726

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.

Upvotes: 1

Related Questions