接口 RequestCallback
- 函数接口:
- 这是一个函数接口, 因此可用作 lambda 表达式或方法引用的赋值目标。
Callback interface for code that operates on a
ClientHttpRequest.
Allows manipulating the request headers, and write to the request body.
Used internally by the RestTemplate, but also useful for
application code. There several available factory methods:
-
方法概要
修饰符和类型方法说明voiddoWithRequest(ClientHttpRequest request) Gets called byRestTemplate.execute(java.lang.String, cn.taketoday.http.HttpMethod, cn.taketoday.web.client.RequestCallback, cn.taketoday.web.client.ResponseExtractor<T>, java.lang.Object...)with an openedClientHttpRequest.
-
方法详细资料
-
doWithRequest
Gets called byRestTemplate.execute(java.lang.String, cn.taketoday.http.HttpMethod, cn.taketoday.web.client.RequestCallback, cn.taketoday.web.client.ResponseExtractor<T>, java.lang.Object...)with an openedClientHttpRequest. Does not need to care about closing the request or about handling errors: this will all be handled by theRestTemplate.- 参数:
request- the active HTTP request- 抛出:
IOException- in case of I/O errors
-