I need to build a servlet that response to a server's request. I'm using HttpURLConnection. Basically the scenario is ServerA request some info from ServerB. When ServerB receive the request, ServerB will give feedback to ServerA. Everything is done backend (without using browser)
During the testing, i built 2 servelts, one requestorA and one responderB. however, the requestorA can never recieve the response from responderB.
below is the code that i use
URL url = null;
HttpURLConnection connection = null;
url = new URL("http://localhost:9080/updateServlet
connection = (HttpURLConnection) url.openConnection();
1) am i doing the right thing?
2) why can't i get any response? what is the right way to do?