Class Apache5HttpResponse
java.lang.Object
com.google.api.client.http.LowLevelHttpResponse
com.google.api.client.http.apache.v5.Apache5HttpResponse
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.apache.hc.core5.http.Header[]
private final org.apache.hc.core5.http.HttpEntity
private static final Logger
private final org.apache.hc.client5.http.classic.methods.HttpUriRequestBase
private final org.apache.hc.core5.http.ClassicHttpResponse
-
Constructor Summary
ConstructorsConstructorDescriptionApache5HttpResponse
(org.apache.hc.client5.http.classic.methods.HttpUriRequestBase request, org.apache.hc.core5.http.ClassicHttpResponse response) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Aborts execution of the request.Returns the HTTP response content input stream ornull
for none.Returns the content encoding (for example"gzip"
) ornull
for none.long
Returns the content length or0
for none.Returns the content type ornull
for none.int
Returns the number of HTTP response headers.getHeaderName
(int index) Returns the HTTP response header name at the given zero-based index.getHeaderValue
(int index) Returns the HTTP response header value at the given zero-based index.getHeaderValue
(String name) Returns the HTTP reason phrase ornull
for none.int
Returns the response status code or<=0
for none.Returns the response status line ornull
for none.
-
Field Details
-
LOGGER
-
request
private final org.apache.hc.client5.http.classic.methods.HttpUriRequestBase request -
response
private final org.apache.hc.core5.http.ClassicHttpResponse response -
allHeaders
private final org.apache.hc.core5.http.Header[] allHeaders -
entity
private final org.apache.hc.core5.http.HttpEntity entity
-
-
Constructor Details
-
Apache5HttpResponse
Apache5HttpResponse(org.apache.hc.client5.http.classic.methods.HttpUriRequestBase request, org.apache.hc.core5.http.ClassicHttpResponse response)
-
-
Method Details
-
getStatusCode
public int getStatusCode()Description copied from class:LowLevelHttpResponse
Returns the response status code or<=0
for none.- Specified by:
getStatusCode
in classLowLevelHttpResponse
-
getContent
Description copied from class:LowLevelHttpResponse
Returns the HTTP response content input stream ornull
for none.- Specified by:
getContent
in classLowLevelHttpResponse
- Throws:
IOException
- I/O exception
-
getContentEncoding
Description copied from class:LowLevelHttpResponse
Returns the content encoding (for example"gzip"
) ornull
for none.- Specified by:
getContentEncoding
in classLowLevelHttpResponse
-
getContentLength
public long getContentLength()Description copied from class:LowLevelHttpResponse
Returns the content length or0
for none.- Specified by:
getContentLength
in classLowLevelHttpResponse
-
getContentType
Description copied from class:LowLevelHttpResponse
Returns the content type ornull
for none.- Specified by:
getContentType
in classLowLevelHttpResponse
-
getReasonPhrase
Description copied from class:LowLevelHttpResponse
Returns the HTTP reason phrase ornull
for none.- Specified by:
getReasonPhrase
in classLowLevelHttpResponse
-
getStatusLine
Description copied from class:LowLevelHttpResponse
Returns the response status line ornull
for none.- Specified by:
getStatusLine
in classLowLevelHttpResponse
-
getHeaderValue
-
getHeaderCount
public int getHeaderCount()Description copied from class:LowLevelHttpResponse
Returns the number of HTTP response headers.Note that multiple headers of the same name need to be supported, in which case each header value is treated as a separate header.
- Specified by:
getHeaderCount
in classLowLevelHttpResponse
-
getHeaderName
Description copied from class:LowLevelHttpResponse
Returns the HTTP response header name at the given zero-based index.- Specified by:
getHeaderName
in classLowLevelHttpResponse
-
getHeaderValue
Description copied from class:LowLevelHttpResponse
Returns the HTTP response header value at the given zero-based index.- Specified by:
getHeaderValue
in classLowLevelHttpResponse
-
disconnect
Aborts execution of the request.- Overrides:
disconnect
in classLowLevelHttpResponse
- Throws:
IOException
- I/O exception
-