Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

SOLVED: 301 ResponseCode in RestTemplate Client

Amit Swain:

Here is the code to get the statelist


HttpHeaders headers = new HttpHeaders();
headers.setAccept(Arrays.asList(MediaType.APPLICATION_JSON));
String baseUri = "http://ift.tt/2rCYfj5";
UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(baseUri)
.queryParam("project-app-key","my-key");
HttpEntity entity = new HttpEntity("parameters", headers);
ResponseEntity stats =restTemplate.exchange(builder.build().toUri(),
HttpMethod.GET,entity ,String.class);



Posted in S.E.F
via StackOverflow & StackExchange Atomic Web Robots
This Question have been answered
HERE


This post first appeared on Stack Solved, please read the originial post: here

Share the post

SOLVED: 301 ResponseCode in RestTemplate Client

×

Subscribe to Stack Solved

Get updates delivered right to your inbox!

Thank you for your subscription

×