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
  • 34,719
  • 24
  • 185
  • 251
Débora
  • 5,684
  • 23
  • 93
  • 164

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
  • 291
  • 1
  • 6