Missing paramenter when I use map (Scala) -


i'm having irritating error can't find explanation for. have code here below:

async{   ws.url(url).get().map{ response =>  //response here giving me error.     ok("response: " + (response.json \ "media_count").as[string])   } } 

and gives me error saying:

missing parameter type 

on response.

where should define parameter type? or error saying more specific?

i think using play.libs.ws meant java api.

the ws.url(...).get() ws class returns promise object of type: promise. map function class takes function instance, not same function1 scala. causing compiler error.

if you're working in scala should use play.api.libs.ws.ws meant work scala library. replace import play.libs.ws import play.api.libs.ws.ws in program , error should go away.


Comments

Popular posts from this blog

c++ - Function signature as a function template parameter -

How to call a javascript function after the page loads with a chrome extension? -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -