|
|
|
|
@ -1,5 +1,5 @@
@@ -1,5 +1,5 @@
|
|
|
|
|
/* |
|
|
|
|
* Copyright 2002-2023 the original author or authors. |
|
|
|
|
* Copyright 2002-2024 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. |
|
|
|
|
@ -145,7 +145,7 @@ public interface RestOperations {
@@ -145,7 +145,7 @@ public interface RestOperations {
|
|
|
|
|
// POST
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Create a new resource by POSTing the given object to the URI template, and returns the value of |
|
|
|
|
* Create a new resource by POSTing the given object to the URI template, and return the value of |
|
|
|
|
* 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 |
|
|
|
|
@ -165,7 +165,7 @@ public interface RestOperations {
@@ -165,7 +165,7 @@ public interface RestOperations {
|
|
|
|
|
URI postForLocation(String url, @Nullable Object request, Object... uriVariables) throws RestClientException; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Create a new resource by POSTing the given object to the URI template, and returns the value of |
|
|
|
|
* Create a new resource by POSTing the given object to the URI template, and return the value of |
|
|
|
|
* 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 |
|
|
|
|
@ -186,7 +186,7 @@ public interface RestOperations {
@@ -186,7 +186,7 @@ public interface RestOperations {
|
|
|
|
|
throws RestClientException; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Create a new resource by POSTing the given object to the URL, and returns the value of the |
|
|
|
|
* Create a new resource by POSTing the given object to the URL, and return 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. |
|
|
|
|
@ -205,7 +205,7 @@ public interface RestOperations {
@@ -205,7 +205,7 @@ public interface RestOperations {
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Create a new resource by POSTing the given object to the URI template, |
|
|
|
|
* and returns the representation found in the response. |
|
|
|
|
* and return 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. |
|
|
|
|
@ -227,7 +227,7 @@ public interface RestOperations {
@@ -227,7 +227,7 @@ public interface RestOperations {
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Create a new resource by POSTing the given object to the URI template, |
|
|
|
|
* and returns the representation found in the response. |
|
|
|
|
* and return 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. |
|
|
|
|
@ -249,7 +249,7 @@ public interface RestOperations {
@@ -249,7 +249,7 @@ public interface RestOperations {
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Create a new resource by POSTing the given object to the URL, |
|
|
|
|
* and returns the representation found in the response. |
|
|
|
|
* and return 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. |
|
|
|
|
* <p>The body of the entity, or {@code request} itself, can be a |
|
|
|
|
@ -268,7 +268,7 @@ public interface RestOperations {
@@ -268,7 +268,7 @@ public interface RestOperations {
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Create a new resource by POSTing the given object to the URI template, |
|
|
|
|
* and returns the response as {@link ResponseEntity}. |
|
|
|
|
* and return 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. |
|
|
|
|
@ -289,7 +289,7 @@ public interface RestOperations {
@@ -289,7 +289,7 @@ public interface RestOperations {
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Create a new resource by POSTing the given object to the URI template, |
|
|
|
|
* and returns the response as {@link HttpEntity}. |
|
|
|
|
* and return 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. |
|
|
|
|
@ -310,7 +310,7 @@ public interface RestOperations {
@@ -310,7 +310,7 @@ public interface RestOperations {
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Create a new resource by POSTing the given object to the URL, |
|
|
|
|
* and returns the response as {@link ResponseEntity}. |
|
|
|
|
* and return 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. |
|
|
|
|
* <p>The body of the entity, or {@code request} itself, can be a |
|
|
|
|
@ -374,7 +374,7 @@ public interface RestOperations {
@@ -374,7 +374,7 @@ public interface RestOperations {
|
|
|
|
|
* <p>The {@code request} parameter can be a {@link HttpEntity} in order to |
|
|
|
|
* add additional HTTP headers to the request. |
|
|
|
|
* <p><b>NOTE: The standard JDK HTTP library does not support HTTP PATCH. |
|
|
|
|
* You need to use the Apache HttpComponents or OkHttp request factory.</b> |
|
|
|
|
* You need to use e.g. the Apache HttpComponents request factory.</b> |
|
|
|
|
* @param url the URL |
|
|
|
|
* @param request the object to be PATCHed (may be {@code null}) |
|
|
|
|
* @param responseType the type of the return value |
|
|
|
|
@ -384,7 +384,6 @@ public interface RestOperations {
@@ -384,7 +384,6 @@ public interface RestOperations {
|
|
|
|
|
* @see HttpEntity |
|
|
|
|
* @see RestTemplate#setRequestFactory |
|
|
|
|
* @see org.springframework.http.client.HttpComponentsClientHttpRequestFactory |
|
|
|
|
* @see org.springframework.http.client.OkHttp3ClientHttpRequestFactory |
|
|
|
|
*/ |
|
|
|
|
@Nullable |
|
|
|
|
<T> T patchForObject(String url, @Nullable Object request, Class<T> responseType, Object... uriVariables) |
|
|
|
|
@ -397,7 +396,7 @@ public interface RestOperations {
@@ -397,7 +396,7 @@ public interface RestOperations {
|
|
|
|
|
* <p>The {@code request} parameter can be a {@link HttpEntity} in order to |
|
|
|
|
* add additional HTTP headers to the request. |
|
|
|
|
* <p><b>NOTE: The standard JDK HTTP library does not support HTTP PATCH. |
|
|
|
|
* You need to use the Apache HttpComponents or OkHttp request factory.</b> |
|
|
|
|
* You need to use e.g. the Apache HttpComponents request factory.</b> |
|
|
|
|
* @param url the URL |
|
|
|
|
* @param request the object to be PATCHed (may be {@code null}) |
|
|
|
|
* @param responseType the type of the return value |
|
|
|
|
@ -407,7 +406,6 @@ public interface RestOperations {
@@ -407,7 +406,6 @@ public interface RestOperations {
|
|
|
|
|
* @see HttpEntity |
|
|
|
|
* @see RestTemplate#setRequestFactory |
|
|
|
|
* @see org.springframework.http.client.HttpComponentsClientHttpRequestFactory |
|
|
|
|
* @see org.springframework.http.client.OkHttp3ClientHttpRequestFactory |
|
|
|
|
*/ |
|
|
|
|
@Nullable |
|
|
|
|
<T> T patchForObject(String url, @Nullable Object request, Class<T> responseType, |
|
|
|
|
@ -419,7 +417,7 @@ public interface RestOperations {
@@ -419,7 +417,7 @@ public interface RestOperations {
|
|
|
|
|
* <p>The {@code request} parameter can be a {@link HttpEntity} in order to |
|
|
|
|
* add additional HTTP headers to the request. |
|
|
|
|
* <p><b>NOTE: The standard JDK HTTP library does not support HTTP PATCH. |
|
|
|
|
* You need to use the Apache HttpComponents or OkHttp request factory.</b> |
|
|
|
|
* You need to use e.g. the Apache HttpComponents request factory.</b> |
|
|
|
|
* @param url the URL |
|
|
|
|
* @param request the object to be PATCHed (may be {@code null}) |
|
|
|
|
* @param responseType the type of the return value |
|
|
|
|
@ -428,7 +426,6 @@ public interface RestOperations {
@@ -428,7 +426,6 @@ public interface RestOperations {
|
|
|
|
|
* @see HttpEntity |
|
|
|
|
* @see RestTemplate#setRequestFactory |
|
|
|
|
* @see org.springframework.http.client.HttpComponentsClientHttpRequestFactory |
|
|
|
|
* @see org.springframework.http.client.OkHttp3ClientHttpRequestFactory |
|
|
|
|
*/ |
|
|
|
|
@Nullable |
|
|
|
|
<T> T patchForObject(URI url, @Nullable Object request, Class<T> responseType) |
|
|
|
|
@ -492,8 +489,8 @@ public interface RestOperations {
@@ -492,8 +489,8 @@ public interface RestOperations {
|
|
|
|
|
// exchange
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Execute the HTTP method to the given URI template, writing the given request entity to the request, and |
|
|
|
|
* returns the response as {@link ResponseEntity}. |
|
|
|
|
* Execute the HTTP method to the given URI template, writing the given request entity to the request, |
|
|
|
|
* and return the response as {@link ResponseEntity}. |
|
|
|
|
* <p>URI Template variables are expanded using the given URI variables, if any. |
|
|
|
|
* @param url the URL |
|
|
|
|
* @param method the HTTP method (GET, POST, etc) |
|
|
|
|
@ -508,8 +505,8 @@ public interface RestOperations {
@@ -508,8 +505,8 @@ public interface RestOperations {
|
|
|
|
|
Class<T> responseType, Object... uriVariables) throws RestClientException; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Execute the HTTP method to the given URI template, writing the given request entity to the request, and |
|
|
|
|
* returns the response as {@link ResponseEntity}. |
|
|
|
|
* Execute the HTTP method to the given URI template, writing the given request entity to the request, |
|
|
|
|
* and return the response as {@link ResponseEntity}. |
|
|
|
|
* <p>URI Template variables are expanded using the given URI variables, if any. |
|
|
|
|
* @param url the URL |
|
|
|
|
* @param method the HTTP method (GET, POST, etc) |
|
|
|
|
@ -524,8 +521,8 @@ public interface RestOperations {
@@ -524,8 +521,8 @@ public interface RestOperations {
|
|
|
|
|
Class<T> responseType, Map<String, ?> uriVariables) throws RestClientException; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Execute the HTTP method to the given URI template, writing the given request entity to the request, and |
|
|
|
|
* returns the response as {@link ResponseEntity}. |
|
|
|
|
* Execute the HTTP method to the given URI template, writing the given request entity to the request, |
|
|
|
|
* and return the response as {@link ResponseEntity}. |
|
|
|
|
* @param url the URL |
|
|
|
|
* @param method the HTTP method (GET, POST, etc) |
|
|
|
|
* @param requestEntity the entity (headers and/or body) to write to the request |
|
|
|
|
@ -539,7 +536,7 @@ public interface RestOperations {
@@ -539,7 +536,7 @@ public interface RestOperations {
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Execute the HTTP method to the given URI template, writing the given |
|
|
|
|
* request entity to the request, and returns the response as {@link ResponseEntity}. |
|
|
|
|
* request entity to the request, and return the response as {@link ResponseEntity}. |
|
|
|
|
* The given {@link ParameterizedTypeReference} is used to pass generic type information: |
|
|
|
|
* <pre class="code"> |
|
|
|
|
* ParameterizedTypeReference<List<MyBean>> myBean = |
|
|
|
|
@ -562,7 +559,7 @@ public interface RestOperations {
@@ -562,7 +559,7 @@ public interface RestOperations {
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Execute the HTTP method to the given URI template, writing the given |
|
|
|
|
* request entity to the request, and returns the response as {@link ResponseEntity}. |
|
|
|
|
* request entity to the request, and return the response as {@link ResponseEntity}. |
|
|
|
|
* The given {@link ParameterizedTypeReference} is used to pass generic type information: |
|
|
|
|
* <pre class="code"> |
|
|
|
|
* ParameterizedTypeReference<List<MyBean>> myBean = |
|
|
|
|
@ -585,7 +582,7 @@ public interface RestOperations {
@@ -585,7 +582,7 @@ public interface RestOperations {
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Execute the HTTP method to the given URI template, writing the given |
|
|
|
|
* request entity to the request, and returns the response as {@link ResponseEntity}. |
|
|
|
|
* request entity to the request, and return the response as {@link ResponseEntity}. |
|
|
|
|
* The given {@link ParameterizedTypeReference} is used to pass generic type information: |
|
|
|
|
* <pre class="code"> |
|
|
|
|
* ParameterizedTypeReference<List<MyBean>> myBean = |
|
|
|
|
|