Polishing
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -21,15 +21,19 @@ import org.springframework.util.ObjectUtils;
|
||||
|
||||
/**
|
||||
* Extension of {@link HttpEntity} that adds a {@link HttpStatus} status code.
|
||||
* Used in {@code RestTemplate} as well {@code @Controller} methods.
|
||||
*
|
||||
* <p>Returned by {@link org.springframework.web.client.RestTemplate#getForEntity}:
|
||||
* <p>In {@code RestTemplate}, this class is returned by
|
||||
* {@link org.springframework.web.client.RestTemplate#getForEntity getForEntity()} and
|
||||
* {@link org.springframework.web.client.RestTemplate#exchange exchange()}:
|
||||
* <pre class="code">
|
||||
* ResponseEntity<String> entity = template.getForEntity("http://example.com", String.class);
|
||||
* String body = entity.getBody();
|
||||
* MediaType contentType = entity.getHeaders().getContentType();
|
||||
* HttpStatus statusCode = entity.getStatusCode();
|
||||
* </pre>
|
||||
* <p>Can also be used in Spring MVC, as a return value from a @Controller method:
|
||||
*
|
||||
* <p>Can also be used in Spring MVC, as the return value from a @Controller method:
|
||||
* <pre class="code">
|
||||
* @RequestMapping("/handle")
|
||||
* public ResponseEntity<String> handle() {
|
||||
|
||||
Reference in New Issue
Block a user