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

pack-priv Class InterceptingClientHttpRequest

extends AbstractBufferingClientHttpRequest
Class Inheritance
Imports
java.io.IOException, .OutputStream, java.net.URI, java.util.Iterator, .List, org.springframework.http.HttpHeaders, .HttpMethod, .HttpRequest, .StreamingHttpOutputMessage, org.springframework.util.StreamUtils

Wrapper for a ClientHttpRequest that has support for ClientHttpRequestInterceptors.
Author
Arjen Poutsma
Since
3.1

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class

Field Summary

Modifier and TypeField and Description
private final List<ClientHttpRequestInterceptor>
private final HttpMethod
private final ClientHttpRequestFactory
private final URI

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
protected final ClientHttpResponse
executeInternal(HttpHeaders
the HTTP headers
headers
,
byte[]
the body content
bufferedOutput
)

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

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

public HttpMethod
getMethod()

Implements org.springframework.http.HttpRequest.getMethod.

Return the HTTP method of the request.

public URI
getURI()

Implements org.springframework.http.HttpRequest.getURI.

Return the URI of the request (including a query string if any, but only if it is well-formed for a URI representation).

Inherited from org.springframework.http.client.AbstractBufferingClientHttpRequest:
executeInternalgetBodyInternal

Field Detail

interceptorsback to summary
private final List<ClientHttpRequestInterceptor> interceptors
methodback to summary
private final HttpMethod method
requestFactoryback to summary
private final ClientHttpRequestFactory requestFactory
uriback to summary
private final URI uri

Constructor Detail

InterceptingClientHttpRequestback to summary
protected InterceptingClientHttpRequest(ClientHttpRequestFactory requestFactory, List<ClientHttpRequestInterceptor> interceptors, URI uri, HttpMethod method)

Method Detail

executeInternalback to summary
protected final ClientHttpResponse executeInternal(HttpHeaders headers, byte[] bufferedOutput) throws IOException

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

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

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

Parameters
headers:HttpHeaders

the HTTP headers

bufferedOutput:byte[]

the body content

Returns:ClientHttpResponse

the response object for the executed request

Annotations
@Override
getMethodback to summary
public HttpMethod getMethod()

Implements org.springframework.http.HttpRequest.getMethod.

Doc from org.springframework.http.HttpRequest.getMethod.

Return the HTTP method of the request.

Returns:HttpMethod

the HTTP method as an HttpMethod value

Annotations
@Override
getURIback to summary
public URI getURI()

Implements org.springframework.http.HttpRequest.getURI.

Doc from org.springframework.http.HttpRequest.getURI.

Return the URI of the request (including a query string if any, but only if it is well-formed for a URI representation).

Returns:URI

the URI of the request (never null)

Annotations
@Override
org.springframework.http.client back to summary

private Class InterceptingClientHttpRequest.InterceptingRequestExecution

extends Object
implements ClientHttpRequestExecution
Class Inheritance
  • java.lang.Object
  • org.springframework.http.client.InterceptingClientHttpRequest.InterceptingRequestExecution
All Implemented Interfaces
org.springframework.http.client.ClientHttpRequestExecution

Field Summary

Modifier and TypeField and Description
private final Iterator<ClientHttpRequestInterceptor>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public ClientHttpResponse
execute(HttpRequest
the request, containing method, URI, and headers
request
,
byte[]
the body of the request to execute
body
)

Implements org.springframework.http.client.ClientHttpRequestExecution.execute.

Execute the request with the given request attributes and body, and return the response.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

iteratorback to summary
private final Iterator<ClientHttpRequestInterceptor> iterator

Constructor Detail

InterceptingRequestExecutionback to summary
public InterceptingRequestExecution()

Method Detail

executeback to summary
public ClientHttpResponse execute(HttpRequest request, byte[] body) throws IOException

Implements org.springframework.http.client.ClientHttpRequestExecution.execute.

Doc from org.springframework.http.client.ClientHttpRequestExecution.execute.

Execute the request with the given request attributes and body, and return the response.

Parameters
request:HttpRequest

the request, containing method, URI, and headers

body:byte[]

the body of the request to execute

Returns:ClientHttpResponse

the response

Annotations
@Override
Exceptions
IOException:
in case of I/O errors