java - Play Framework: Cannot find symbol "async" -


I am using and I try to use the built in HTTP request in WS support I am doing Whenever I try this HTTP request in an administrator, I get this error

  error:   

for code (static result) foo () {error on this line for async (// `async ') WS.url (GoogleStrategy.getTokenUrl) .post (getTokenUrlParams) .map (New F.Function & LT; WSResponse, Object & gt; () {@Override Public Object Applied (WSResponse wsResponse) Throwing Throws {OK Return (wsResponse.asJson ())}}})); }

It is weird because in all the examples shown in the documentation, this is the right way to do fast work which I want to do.

You were almost certainly looking at the old version of the document. async () is no longer required.

Current version:

  Public stable promise & lt; Results & gt; foo () {return WS.url (GoogleStrategy.getTokenUrl) .post (getTokenUrlParams) .map (New F.Function & LT; WSResponse, Result & gt; () {@Override Public Objects Applied (WSResponse wsResponse) The return is fine (wsResponse.jsjson ());}}); }    

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -