public interface

RequestCallback

org.springframework.web.client.RequestCallback

Class Overview

Callback interface for code that operates on a ClientHttpRequest. Allows to manipulate the request headers, and write to the request body.

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

Summary

Public Methods
abstract void doWithRequest(ClientHttpRequest request)

Public Methods

public abstract void doWithRequest (ClientHttpRequest request)

Gets called by execute(String, HttpMethod, RequestCallback, ResponseExtractor, Object...) 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.

Parameters
request the active HTTP request
Throws
IOException in case of I/O errors