public interface RestRequestCallback
| Modifier and Type | Method and Description |
|---|---|
default <T> T |
afterRequest(org.springframework.web.client.RestTemplate restTemplate,
URI uri,
org.springframework.http.HttpMethod method,
org.springframework.http.HttpEntity<?> httpEntity,
Class<T> responseType,
T responseBody)
用于在返回结果之前,做某些处理操作
|
default <T> void |
beforeRequest(org.springframework.web.client.RestTemplate restTemplate,
URI uri,
org.springframework.http.HttpHeaders httpHeaders,
org.springframework.http.HttpMethod method,
Object requestBody,
Class<T> responseType)
用于在发送请求之前,做某些处理操作
|
default <T> void |
onThrowException(org.springframework.web.client.RestTemplate restTemplate,
URI uri,
org.springframework.http.HttpMethod method,
org.springframework.http.HttpEntity<?> httpEntity,
Class<T> responseType,
Exception ex)
用于在发生异常的时候,做某些处理操作
|
default <T> void beforeRequest(org.springframework.web.client.RestTemplate restTemplate,
URI uri,
org.springframework.http.HttpHeaders httpHeaders,
org.springframework.http.HttpMethod method,
Object requestBody,
Class<T> responseType)
T - 数据类型class的泛形restTemplate - RestTemplateuri - 请求的urihttpHeaders - 自定义HttpHeadersmethod - 请求方法类型requestBody - 请求的内容responseType - 返回的数据类型default <T> T afterRequest(org.springframework.web.client.RestTemplate restTemplate,
URI uri,
org.springframework.http.HttpMethod method,
org.springframework.http.HttpEntity<?> httpEntity,
Class<T> responseType,
T responseBody)
T - 数据类型class的泛形restTemplate - RestTemplateuri - 请求的urimethod - 请求方法类型httpEntity - 请求的内容responseType - 返回的数据类型responseBody - 请求结果default <T> void onThrowException(org.springframework.web.client.RestTemplate restTemplate,
URI uri,
org.springframework.http.HttpMethod method,
org.springframework.http.HttpEntity<?> httpEntity,
Class<T> responseType,
Exception ex)
T - 数据类型class的泛形restTemplate - RestTemplateuri - 请求的urimethod - 请求方法类型httpEntity - 请求的内容responseType - 返回的数据类型ex - 异常信息Copyright © 2018. All rights reserved.