Issue
Its just submitting the sitemap to google so far i have
RestTemplate restTemplate = new RestTemplate();
HttpEntity<?> responseEntity = restTemplate.getForEntity("http://www.google.com/webmasters/tools/ping?sitemap={url}", String.class,"http://mySite.com/sitemap.txt);
How do I check the server HTTP status that is returned?
Solution
restTemplate.getForEntity(String, Class<T>, String...)
returns a ResponseEntity<T>
(extends HttpEntity
), which has a method for retrieving the status code.
ResponseEntity.getStatusCode()
You should utilize that instead of HttpEntity
.
Answered By - nicholas.hauschild