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

pack-priv Class OkHttp3ClientHttpResponse

extends Object
implements ClientHttpResponse
Class Inheritance
All Implemented Interfaces
org.springframework.http.client.ClientHttpResponse, java.io.Closeable, java.lang.AutoCloseable, org.springframework.http.HttpInputMessage, org.springframework.http.HttpMessage
Annotations
@Deprecated
since:6.1
forRemoval:true
Imports
java.io.IOException, .InputStream, okhttp3.Response, okhttp3.ResponseBody, org.springframework.http.HttpHeaders, .HttpStatusCode, org.springframework.lang.Nullable, org.springframework.util.Assert

Deprecated

for removal since 6.1.

ClientHttpResponse implementation based on OkHttp 3.x.
Authors
Luciano Leggieri, Arjen Poutsma, Roy Clarkson
Since
4.3

Field Summary

Modifier and TypeField and Description
private volatile HttpHeaders
private final okhttp3.Response

Constructor Summary

AccessConstructor and Description
public
OkHttp3ClientHttpResponse(okhttp3.Response response)

Method Summary

Modifier and TypeMethod and Description
public void
close()

Implements org.springframework.http.client.ClientHttpResponse.close.

Close this response, freeing any resources created.
public InputStream
getBody()

Implements org.springframework.http.HttpInputMessage.getBody.

Return the body of the message as an input stream.
public HttpHeaders
getHeaders()

Implements org.springframework.http.HttpMessage.getHeaders.

Return the headers of this message.
public HttpStatusCode
public String
getStatusText()

Implements org.springframework.http.client.ClientHttpResponse.getStatusText.

Get the HTTP status text of the response.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

headersback to summary
private volatile HttpHeaders headers
Annotations
@Nullable
responseback to summary
private final okhttp3.Response response

Constructor Detail

OkHttp3ClientHttpResponseback to summary
public OkHttp3ClientHttpResponse(okhttp3.Response response)

Method Detail

closeback to summary
public void close()

Implements org.springframework.http.client.ClientHttpResponse.close.

Doc from org.springframework.http.client.ClientHttpResponse.close.

Close this response, freeing any resources created.

Annotations
@Override
getBodyback to summary
public InputStream getBody() throws IOException

Implements org.springframework.http.HttpInputMessage.getBody.

Doc from org.springframework.http.HttpInputMessage.getBody.

Return the body of the message as an input stream.

Returns:InputStream

the input stream body (never null)

Annotations
@Override
Exceptions
IOException:
in case of I/O errors
getHeadersback to summary
public HttpHeaders getHeaders()

Implements org.springframework.http.HttpMessage.getHeaders.

Doc from org.springframework.http.HttpMessage.getHeaders.

Return the headers of this message.

Returns:HttpHeaders

a corresponding HttpHeaders object (never null)

Annotations
@Override
getStatusCodeback to summary
public HttpStatusCode getStatusCode() throws IOException

Implements org.springframework.http.client.ClientHttpResponse.getStatusCode.

Doc from org.springframework.http.client.ClientHttpResponse.getStatusCode.

Get the HTTP status code as an HttpStatusCode.

Returns:HttpStatusCode

the HTTP status as HttpStatusCode value (never null)

Annotations
@Override
Exceptions
IOException:
in case of I/O errors
getStatusTextback to summary
public String getStatusText()

Implements org.springframework.http.client.ClientHttpResponse.getStatusText.

Doc from org.springframework.http.client.ClientHttpResponse.getStatusText.

Get the HTTP status text of the response.

Returns:String

the HTTP status text

Annotations
@Override