spring-framework / org.springframework.http.client / SimpleClientHttpRequestFactory / setBufferRequestBody

setBufferRequestBody

open fun setBufferRequestBody(bufferRequestBody: Boolean): Unit

Indicate whether this request factory should buffer the request body internally.

Default is true. When sending large amounts of data via POST or PUT, it is recommended to change this property to false, so as not to run out of memory. This will result in a ClientHttpRequest that either streams directly to the underlying HttpURLConnection (if the Content-Length is known in advance), or that will use "Chunked transfer encoding" (if the Content-Length is not known in advance).

See Also
#setChunkSize(int)HttpURLConnection#setFixedLengthStreamingMode(int)