Chomik Rufus wrote:Is there any kind of way to generate HTTP request within a servlet, dispatch it to the server and get back the answer delivered to the servlet? Or are the servlets meant only to respond to passed requests, not generate them?
Chomik Rufus wrote:(FYI I asked a similar question here: https://coderanch.com/t/493784/Tomcat/Filtering-creating-outgoing-requests but no luck)
Making a web service request from a servlet is no different than doing it any other way.
Ulf Dittmer wrote:You could use the HttpClient library to send a request and read the result; the servlet API itself has no support for this.