Web applications sometimes make use of an external web service. For this purpose, Play provides an HTTP client. To use it, add the following dependency to your build:
libraryDependencies += ws
In Java, the library is named
libraryDependencies += javaWs
Though some web services can be freely used, most of them provide only authenticated APIs. The OAuth 2.0 protocol is often used as an authentication system. You can find more about OAuth at http://oauth.net/2/. Incidentally, authenticating using OAuth requires calling a web service (the authorization server as depicted in the following figure), so we will implement an OAuth client to illustrate how to call web services:
As a reminder, ...