1

I want to send a request to another server from my servlet and get the response being in the same servlet. For Example: arequest :

http://www.anotherserver.com?para=pValue    

is sent to anotherserver, and get the response which it sends and then process the response.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Débora
  • 5,816
  • 28
  • 99
  • 171

1 Answers1

1

You can use Apache HttpClient (http://hc.apache.org/httpcomponents-client-ga/index.html) in your Java code to make HTTP calls.

Example: http://hc.apache.org/httpcomponents-client-ga/httpclient/examples/org/apache/http/examples/client/ClientWithResponseHandler.java

Gz Zheng
  • 311
  • 2
  • 7