Top Description Fields Constructors Methods
org.springframework.http.client

pack-priv abstract Class AbstractStreamingClientHttpRequest

extends AbstractClientHttpRequest
implements StreamingHttpOutputMessage
Class Inheritance
All Implemented Interfaces
org.springframework.http.StreamingHttpOutputMessage, org.springframework.http.HttpOutputMessage, org.springframework.http.HttpMessage
Known Direct Subclasses
org.springframework.http.client.HttpComponentsClientHttpRequest, org.springframework.http.client.JdkClientHttpRequest, org.springframework.http.client.OkHttp3ClientHttpRequest, org.springframework.http.client.ReactorNettyClientRequest, org.springframework.http.client.SimpleClientHttpRequest, org.springframework.http.client.JettyClientHttpRequest
Imports
java.io.IOException, .OutputStream, org.springframework.http.HttpHeaders, .StreamingHttpOutputMessage, org.springframework.lang.Nullable, org.springframework.util.Assert, .FastByteArrayOutputStream

Abstract base for ClientHttpRequest that also implement StreamingHttpOutputMessage. Ensures that headers and body are not written multiple times.
Author
Arjen Poutsma
Since
6.1

Field Summary

Modifier and TypeField and Description
private StreamingHttpOutputMessage.Body
private FastByteArrayOutputStream

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
protected final ClientHttpResponse
executeInternal(HttpHeaders
the HTTP headers
headers
)

Implements abstract org.springframework.http.client.AbstractClientHttpRequest.executeInternal.

Abstract template method that writes the given headers and content to the HTTP request.

protected abstract ClientHttpResponse

Returns:

the response object for the executed request
executeInternal
(HttpHeaders
the HTTP headers
headers
,
StreamingHttpOutputMessage.Body
the HTTP body, may be null if no body was set
body
)

Abstract template method that writes the given headers and content to the HTTP request.

protected final OutputStream
getBodyInternal(HttpHeaders
the HTTP headers
headers
)

Implements abstract org.springframework.http.client.AbstractClientHttpRequest.getBodyInternal.

Abstract template method that returns the body.

public final void
setBody(StreamingHttpOutputMessage.Body
the streaming body callback
body
)

Implements org.springframework.http.StreamingHttpOutputMessage.setBody.

Set the streaming body callback for this message.

Inherited from org.springframework.http.client.AbstractClientHttpRequest:
assertNotExecutedexecutegetBodygetHeaders

Field Detail

bodyback to summary
private StreamingHttpOutputMessage.Body body
Annotations
@Nullable
bodyStreamback to summary
private FastByteArrayOutputStream bodyStream
Annotations
@Nullable

Constructor Detail

AbstractStreamingClientHttpRequestback to summary
pack-priv AbstractStreamingClientHttpRequest()

Method Detail

executeInternalback to summary
protected final ClientHttpResponse executeInternal(HttpHeaders headers) throws IOException

Implements abstract org.springframework.http.client.AbstractClientHttpRequest.executeInternal.

Doc from org.springframework.http.client.AbstractClientHttpRequest.executeInternal.

Abstract template method that writes the given headers and content to the HTTP request.

Parameters
headers:HttpHeaders

the HTTP headers

Returns:ClientHttpResponse

the response object for the executed request

Annotations
@Override
executeInternalback to summary
protected abstract ClientHttpResponse executeInternal(HttpHeaders headers, StreamingHttpOutputMessage.Body body) throws IOException

Abstract template method that writes the given headers and content to the HTTP request.

Parameters
headers:HttpHeaders

the HTTP headers

body:StreamingHttpOutputMessage.Body

the HTTP body, may be null if no body was set

Returns:ClientHttpResponse

the response object for the executed request

Since
6.1
getBodyInternalback to summary
protected final OutputStream getBodyInternal(HttpHeaders headers)

Implements abstract org.springframework.http.client.AbstractClientHttpRequest.getBodyInternal.

Doc from org.springframework.http.client.AbstractClientHttpRequest.getBodyInternal.

Abstract template method that returns the body.

Parameters
headers:HttpHeaders

the HTTP headers

Returns:OutputStream

the body output stream

Annotations
@Override
setBodyback to summary
public final void setBody(StreamingHttpOutputMessage.Body body)

Implements org.springframework.http.StreamingHttpOutputMessage.setBody.

Doc from org.springframework.http.StreamingHttpOutputMessage.setBody.

Set the streaming body callback for this message.

Parameters
body:StreamingHttpOutputMessage.Body

the streaming body callback

Annotations
@Override