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.HttpEntityprivate static final Loggerprivate final org.apache.hc.client5.http.classic.methods.HttpUriRequestBaseprivate 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 TypeMethodDescriptionvoidAborts execution of the request.Returns the HTTP response content input stream ornullfor none.Returns the content encoding (for example"gzip") ornullfor none.longReturns the content length or0for none.Returns the content type ornullfor none.intReturns 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 ornullfor none.intReturns the response status code or<=0for none.Returns the response status line ornullfor 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:LowLevelHttpResponseReturns the response status code or<=0for none.- Specified by:
getStatusCodein classLowLevelHttpResponse
-
getContent
Description copied from class:LowLevelHttpResponseReturns the HTTP response content input stream ornullfor none.- Specified by:
getContentin classLowLevelHttpResponse- Throws:
IOException- I/O exception
-
getContentEncoding
Description copied from class:LowLevelHttpResponseReturns the content encoding (for example"gzip") ornullfor none.- Specified by:
getContentEncodingin classLowLevelHttpResponse
-
getContentLength
public long getContentLength()Description copied from class:LowLevelHttpResponseReturns the content length or0for none.- Specified by:
getContentLengthin classLowLevelHttpResponse
-
getContentType
Description copied from class:LowLevelHttpResponseReturns the content type ornullfor none.- Specified by:
getContentTypein classLowLevelHttpResponse
-
getReasonPhrase
Description copied from class:LowLevelHttpResponseReturns the HTTP reason phrase ornullfor none.- Specified by:
getReasonPhrasein classLowLevelHttpResponse
-
getStatusLine
Description copied from class:LowLevelHttpResponseReturns the response status line ornullfor none.- Specified by:
getStatusLinein classLowLevelHttpResponse
-
getHeaderValue
-
getHeaderCount
public int getHeaderCount()Description copied from class:LowLevelHttpResponseReturns 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:
getHeaderCountin classLowLevelHttpResponse
-
getHeaderName
Description copied from class:LowLevelHttpResponseReturns the HTTP response header name at the given zero-based index.- Specified by:
getHeaderNamein classLowLevelHttpResponse
-
getHeaderValue
Description copied from class:LowLevelHttpResponseReturns the HTTP response header value at the given zero-based index.- Specified by:
getHeaderValuein classLowLevelHttpResponse
-
disconnect
Aborts execution of the request.- Overrides:
disconnectin classLowLevelHttpResponse- Throws:
IOException- I/O exception
-