How to debug HTTP request?

How do you make an HTTP Request from a spring application to a non-spring application?

  • I am working on a spring application which has to make a HTTP call to another application(not running on Spring). 1) Make a HTTP request (say http://www.mysite.com) with required parameters 2) Get the response of the request and process the same. I cannot use Spring's HTTP Invokers as the other applicationĀ  is not running on spring.... What are the other options to invoke a HTTP request call using spring framework?

  • Answer:

    The answer for this is the same as if you weren't using Spring - you can use http://java.net.HttpURLConnection, or another http client class such as commons-httpclient (http://hc.apache.org/httpcomponents-client-ga/), which is pretty simple to use. If the other application has a REST-like interface, you can use Spring's RestTemplate.

Matt Brown at Quora Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.