POST data from a service to another one in Play

I need to POST data through java playframework to another service which is build on a different language.
I am using playframework 2.6.20 version.

Suppose , the service is running on localhost:8081 . I need to post to /test

        {

          data: {
            something: something
          },
          headers: {
            "Content-Type": "application/json"
          }
        }

How do I call this from my java play code. I couldn’t find any documentation regarding this.

you can use WSClient of play framework.

https://www.playframework.com/documentation/2.7.x/JavaWS

2 Likes