Reputation: 7953
I really don't know how to proceed with this in Spring.
I have an URL https://test.payu.in/merchant/postservice.php?form=2
which I have to call with some parameters and consume the result.
How can I do it with Spring ?
Upvotes: 1
Views: 4407
Reputation: 62864
You can use RestTemplate, which supports mashalling, unmarshalling, variable resolution, etc.
For example, you have to do something similar to this:
Map<String, String> vars = new HashMap<String, String>();
vars.put("hotel", "42");
vars.put("booking", "21");
String result =
restTemplate.getForObject("http://example.com/hotels/{hotel}/bookings/{booking}", String.class, vars);
More info:
Upvotes: 4