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.
Asked
Active
Viewed 159 times
-1
-
Please provide enough code so others can better understand or reproduce the problem. – igreenfield Mar 21 '22 at 08:02
1 Answers
0
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.

stepanian
- 11,373
- 8
- 43
- 63
-
Thanks @stepanian for your interest and recommendation. We have an existing javascript library which unfortunately cannot be changed to node application. The functions of this library is called in java using GraalJs. – Rahul Mar 23 '22 at 01:40