How to call javascript function making a axios api call from java

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.