Majid Lotfinia
Majid Lotfinia

Reputation: 714

play framework 2.6 ws cannot resolve

I use play framework 2.6 I need to send a http request to an url, so I use WS for sending this request first I add below line to sbt.build

    libraryDependencies += ws

but in controller play cannot resolve ws package

    import play.libs.ws.*;

how can I add play.libs.ws to controller???

Upvotes: 0

Views: 850

Answers (1)

Dmytro Mitin
Dmytro Mitin

Reputation: 51703

Try to add

libraryDependencies += "com.typesafe.play" %% "play-ws" % "2.6.3"

to build.sbt (where you can specify proper version instead of 2.6.3) and refresh SBT project.

Then

import play.libs.ws._

in Scala or

import play.libs.ws.*;

in Java should work.

If there is an issue with resolving dependencies try sbt clean + sbt update or re-import the project to IDE.

Upvotes: 2

Related Questions