Update reference with examples of multipart requests

Issue: SPR-16118
This commit is contained in:
Rossen Stoyanchev
2017-11-06 16:28:27 -05:00
parent 4ec60f08ad
commit 14f02d7192
9 changed files with 247 additions and 135 deletions

View File

@@ -149,9 +149,13 @@ public interface RestOperations {
* the {@code Location} header. This header typically indicates where the new resource is stored.
* <p>URI Template variables are expanded using the given URI variables, if any.
* <p>The {@code request} parameter can be a {@link HttpEntity} in order to
* add additional HTTP headers to the request. The body of the entity, or {@code request} itself,
* can be a {@link org.springframework.http.client.MultipartBodyBuilder MultiValueMap} to
* simulate a multipart from submission.
* add additional HTTP headers to the request.
* <p>The body of the entity, or {@code request} itself, can be a
* {@link org.springframework.util.MultiValueMap MultiValueMap} to create a multipart request.
* The values in the {@code MultiValueMap} can be any Object representing the body of the part,
* or an {@link org.springframework.http.HttpEntity HttpEntity} representing a part with body
* and headers. The {@code MultiValueMap} can be built conveniently using
* {@link org.springframework.http.client.MultipartBodyBuilder MultipartBodyBuilder}.
* @param url the URL
* @param request the Object to be POSTed (may be {@code null})
* @param uriVariables the variables to expand the template
@@ -166,9 +170,13 @@ public interface RestOperations {
* the {@code Location} header. This header typically indicates where the new resource is stored.
* <p>URI Template variables are expanded using the given map.
* <p>The {@code request} parameter can be a {@link HttpEntity} in order to
* add additional HTTP headers to the request. The body of the entity, or {@code request} itself,
* can be a {@link org.springframework.http.client.MultipartBodyBuilder MultiValueMap} to
* simulate a multipart from submission.
* add additional HTTP headers to the request
* <p>The body of the entity, or {@code request} itself, can be a
* {@link org.springframework.util.MultiValueMap MultiValueMap} to create a multipart request.
* The values in the {@code MultiValueMap} can be any Object representing the body of the part,
* or an {@link org.springframework.http.HttpEntity HttpEntity} representing a part with body
* and headers. The {@code MultiValueMap} can be built conveniently using
* {@link org.springframework.http.client.MultipartBodyBuilder MultipartBodyBuilder}.
* @param url the URL
* @param request the Object to be POSTed (may be {@code null})
* @param uriVariables the variables to expand the template
@@ -183,9 +191,13 @@ public interface RestOperations {
* Create a new resource by POSTing the given object to the URL, and returns the value of the
* {@code Location} header. This header typically indicates where the new resource is stored.
* <p>The {@code request} parameter can be a {@link HttpEntity} in order to
* add additional HTTP headers to the request. The body of the entity, or {@code request} itself,
* can be a {@link org.springframework.http.client.MultipartBodyBuilder MultiValueMap} to
* simulate a multipart from submission.
* add additional HTTP headers to the request.
* <p>The body of the entity, or {@code request} itself, can be a
* {@link org.springframework.util.MultiValueMap MultiValueMap} to create a multipart request.
* The values in the {@code MultiValueMap} can be any Object representing the body of the part,
* or an {@link org.springframework.http.HttpEntity HttpEntity} representing a part with body
* and headers. The {@code MultiValueMap} can be built conveniently using
* {@link org.springframework.http.client.MultipartBodyBuilder MultipartBodyBuilder}.
* @param url the URL
* @param request the Object to be POSTed (may be {@code null})
* @return the value for the {@code Location} header
@@ -199,9 +211,13 @@ public interface RestOperations {
* and returns the representation found in the response.
* <p>URI Template variables are expanded using the given URI variables, if any.
* <p>The {@code request} parameter can be a {@link HttpEntity} in order to
* add additional HTTP headers to the request. The body of the entity, or {@code request} itself,
* can be a {@link org.springframework.http.client.MultipartBodyBuilder MultiValueMap} to
* simulate a multipart from submission.
* add additional HTTP headers to the request.
* <p>The body of the entity, or {@code request} itself, can be a
* {@link org.springframework.util.MultiValueMap MultiValueMap} to create a multipart request.
* The values in the {@code MultiValueMap} can be any Object representing the body of the part,
* or an {@link org.springframework.http.HttpEntity HttpEntity} representing a part with body
* and headers. The {@code MultiValueMap} can be built conveniently using
* {@link org.springframework.http.client.MultipartBodyBuilder MultipartBodyBuilder}.
* @param url the URL
* @param request the Object to be POSTed (may be {@code null})
* @param responseType the type of the return value
@@ -218,9 +234,13 @@ public interface RestOperations {
* and returns the representation found in the response.
* <p>URI Template variables are expanded using the given map.
* <p>The {@code request} parameter can be a {@link HttpEntity} in order to
* add additional HTTP headers to the request. The body of the entity, or {@code request} itself,
* can be a {@link org.springframework.http.client.MultipartBodyBuilder MultiValueMap} to
* simulate a multipart from submission.
* add additional HTTP headers to the request.
* <p>The body of the entity, or {@code request} itself, can be a
* {@link org.springframework.util.MultiValueMap MultiValueMap} to create a multipart request.
* The values in the {@code MultiValueMap} can be any Object representing the body of the part,
* or an {@link org.springframework.http.HttpEntity HttpEntity} representing a part with body
* and headers. The {@code MultiValueMap} can be built conveniently using
* {@link org.springframework.http.client.MultipartBodyBuilder MultipartBodyBuilder}.
* @param url the URL
* @param request the Object to be POSTed (may be {@code null})
* @param responseType the type of the return value
@@ -236,9 +256,13 @@ public interface RestOperations {
* Create a new resource by POSTing the given object to the URL,
* and returns the representation found in the response.
* <p>The {@code request} parameter can be a {@link HttpEntity} in order to
* add additional HTTP headers to the request. The body of the entity, or {@code request} itself,
* can be a {@link org.springframework.http.client.MultipartBodyBuilder MultiValueMap} to
* simulate a multipart from submission.
* add additional HTTP headers to the request.
* <p>The body of the entity, or {@code request} itself, can be a
* {@link org.springframework.util.MultiValueMap MultiValueMap} to create a multipart request.
* The values in the {@code MultiValueMap} can be any Object representing the body of the part,
* or an {@link org.springframework.http.HttpEntity HttpEntity} representing a part with body
* and headers. The {@code MultiValueMap} can be built conveniently using
* {@link org.springframework.http.client.MultipartBodyBuilder MultipartBodyBuilder}.
* @param url the URL
* @param request the Object to be POSTed (may be {@code null})
* @param responseType the type of the return value
@@ -253,9 +277,13 @@ public interface RestOperations {
* and returns the response as {@link ResponseEntity}.
* <p>URI Template variables are expanded using the given URI variables, if any.
* <p>The {@code request} parameter can be a {@link HttpEntity} in order to
* add additional HTTP headers to the request. The body of the entity, or {@code request} itself,
* can be a {@link org.springframework.http.client.MultipartBodyBuilder MultiValueMap} to
* simulate a multipart from submission.
* add additional HTTP headers to the request.
* <p>The body of the entity, or {@code request} itself, can be a
* {@link org.springframework.util.MultiValueMap MultiValueMap} to create a multipart request.
* The values in the {@code MultiValueMap} can be any Object representing the body of the part,
* or an {@link org.springframework.http.HttpEntity HttpEntity} representing a part with body
* and headers. The {@code MultiValueMap} can be built conveniently using
* {@link org.springframework.http.client.MultipartBodyBuilder MultipartBodyBuilder}.
* @param url the URL
* @param request the Object to be POSTed (may be {@code null})
* @param uriVariables the variables to expand the template
@@ -271,9 +299,13 @@ public interface RestOperations {
* and returns the response as {@link HttpEntity}.
* <p>URI Template variables are expanded using the given map.
* <p>The {@code request} parameter can be a {@link HttpEntity} in order to
* add additional HTTP headers to the request. The body of the entity, or {@code request} itself,
* can be a {@link org.springframework.http.client.MultipartBodyBuilder MultiValueMap} to
* simulate a multipart from submission.
* add additional HTTP headers to the request.
* <p>The body of the entity, or {@code request} itself, can be a
* {@link org.springframework.util.MultiValueMap MultiValueMap} to create a multipart request.
* The values in the {@code MultiValueMap} can be any Object representing the body of the part,
* or an {@link org.springframework.http.HttpEntity HttpEntity} representing a part with body
* and headers. The {@code MultiValueMap} can be built conveniently using
* {@link org.springframework.http.client.MultipartBodyBuilder MultipartBodyBuilder}.
* @param url the URL
* @param request the Object to be POSTed (may be {@code null})
* @param uriVariables the variables to expand the template
@@ -288,9 +320,13 @@ public interface RestOperations {
* Create a new resource by POSTing the given object to the URL,
* and returns the response as {@link ResponseEntity}.
* <p>The {@code request} parameter can be a {@link HttpEntity} in order to
* add additional HTTP headers to the request. The body of the entity, or {@code request} itself,
* can be a {@link org.springframework.http.client.MultipartBodyBuilder MultiValueMap} to
* simulate a multipart from submission.
* add additional HTTP headers to the request.
* <p>The body of the entity, or {@code request} itself, can be a
* {@link org.springframework.util.MultiValueMap MultiValueMap} to create a multipart request.
* The values in the {@code MultiValueMap} can be any Object representing the body of the part,
* or an {@link org.springframework.http.HttpEntity HttpEntity} representing a part with body
* and headers. The {@code MultiValueMap} can be built conveniently using
* {@link org.springframework.http.client.MultipartBodyBuilder MultipartBodyBuilder}.
* @param url the URL
* @param request the Object to be POSTed (may be {@code null})
* @return the converted object