Play-ws post() "adaption of argument list deprecation" compile error


(Julian Wilson) #1


I’m trying to use play-ws to make some HTTP requests on the server-side and I’m using the .post() method on the ws object. I’m getting the compiler error where it is trying to coerce Unit into the arguments of .post(). My play version is 2.6.7 and my scala version is 2.12.4. Here’s the code (pretty simple){
          response =>

and my error:

[error] /home/julian/IdeaProjects/my-app/app-admin/src/main/scala/admin/controllers/HomeController.scala:94:15: Adaptation of argument list by inserting () is deprecated: this is unlikely to be what you want.
[error]         signature:[T](body: T)(implicit evidence$2:[T]): scala.concurrent.Future[WSRequest.this.Response]
[error]   given arguments: <none>
[error]  after adaptation: Unit)
[error]               ^
[error] one error found
[error] (app-admin/compile:compileIncremental) Compilation failed
[error] Total time: 4 s, completed 5-Apr-2018 6:08:38 PM

Any ideas? I’m guessing it some version issue?


(Rich Dougherty) #2

Scala is expecting you to call Since you’re just saying it’s assuming you’re supplying () as the body, i.e. doing the same as What body do you want to post?

(Julian Wilson) #3

Thank you! Silly mistake. The endpoint was requiring get() and so this wasn’t necessary.

(Rich Dougherty) #4

No problem, glad it’s working for you.