Class Apache5HttpRequest
java.lang.Object
com.google.api.client.http.LowLevelHttpRequest
com.google.api.client.http.apache.v5.Apache5HttpRequest
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.apache.hc.client5.http.classic.HttpClientprivate final org.apache.hc.client5.http.classic.methods.HttpUriRequestBaseprivate final org.apache.hc.client5.http.config.RequestConfig.Builder -
Constructor Summary
ConstructorsConstructorDescriptionApache5HttpRequest(org.apache.hc.client5.http.classic.HttpClient httpClient, org.apache.hc.client5.http.classic.methods.HttpUriRequestBase request) -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a header to the HTTP request.execute()Executes the request and returns a low-level HTTP response object.voidsetTimeout(int connectTimeout, int readTimeout) Sets the connection and read timeouts.Methods inherited from class LowLevelHttpRequest
getContentEncoding, getContentLength, getContentType, getStreamingContent, setContentEncoding, setContentLength, setContentType, setStreamingContent, setWriteTimeout
-
Field Details
-
request
private final org.apache.hc.client5.http.classic.methods.HttpUriRequestBase request -
requestConfig
private final org.apache.hc.client5.http.config.RequestConfig.Builder requestConfig -
httpClient
private final org.apache.hc.client5.http.classic.HttpClient httpClient
-
-
Constructor Details
-
Apache5HttpRequest
Apache5HttpRequest(org.apache.hc.client5.http.classic.HttpClient httpClient, org.apache.hc.client5.http.classic.methods.HttpUriRequestBase request)
-
-
Method Details
-
addHeader
Description copied from class:LowLevelHttpRequestAdds a header to the HTTP request.Note that multiple headers of the same name need to be supported, in which case
LowLevelHttpRequest.addHeader(String, String)will be called for each instance of the header.- Specified by:
addHeaderin classLowLevelHttpRequest- Parameters:
name- header namevalue- header value
-
setTimeout
Description copied from class:LowLevelHttpRequestSets the connection and read timeouts.Default implementation does nothing, but subclasses should normally override.
- Overrides:
setTimeoutin classLowLevelHttpRequest- Parameters:
connectTimeout- timeout in milliseconds to establish a connection or0for an infinite timeoutreadTimeout- Timeout in milliseconds to read data from an established connection or0for an infinite timeout- Throws:
IOException- I/O exception
-
execute
Description copied from class:LowLevelHttpRequestExecutes the request and returns a low-level HTTP response object.- Specified by:
executein classLowLevelHttpRequest- Throws:
IOException
-