Class ApacheHttpResponse
java.lang.Object
com.google.api.client.http.LowLevelHttpResponse
com.google.api.client.http.apache.v2.ApacheHttpResponse
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.apache.http.Header[]private final org.apache.http.client.methods.HttpRequestBaseprivate final org.apache.http.HttpResponse -
Constructor Summary
ConstructorsConstructorDescriptionApacheHttpResponse(org.apache.http.client.methods.HttpRequestBase request, org.apache.http.HttpResponse 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
-
request
private final org.apache.http.client.methods.HttpRequestBase request -
response
private final org.apache.http.HttpResponse response -
allHeaders
private final org.apache.http.Header[] allHeaders
-
-
Constructor Details
-
ApacheHttpResponse
ApacheHttpResponse(org.apache.http.client.methods.HttpRequestBase request, org.apache.http.HttpResponse 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
public void disconnect()Aborts execution of the request.- Overrides:
disconnectin classLowLevelHttpResponse- Since:
- 1.30
-