spring-framework / org.springframework.web.client / AsyncRequestCallback

AsyncRequestCallback

@FunctionalInterface interface AsyncRequestCallback

Callback interface for code that operates on an org.springframework.http.client.AsyncClientHttpRequest. Allows to manipulate the request headers, and write to the request body.

Used internally by the AsyncRestTemplate, but also useful for application code.

Author
Arjen Poutsma

See Also
org.springframework.web.client.AsyncRestTemplate#execute

Since
4.0

Functions

doWithRequest

abstract fun doWithRequest(request: AsyncClientHttpRequest): Unit

Gets called by AsyncRestTemplate#execute with an opened ClientHttpRequest. Does not need to care about closing the request or about handling errors: this will all be handled by the RestTemplate.