I have a javascript function which make a network call using the axios library. The function supports for GET and POST. My requirement is to call the same javascript function from Java, which internally will make a network call using axios.
You can create a node.js application that uses the axios library to accomplish what you need and call it from Java with code similar to this:
Runtime run = Runtime.getRuntime();
run.exec(command);
That said, Java has excellent libraries for networking to probably fit your requirement.