public class GetRequest extends org.apache.http.client.methods.HttpGet implements org.apache.http.client.ResponseHandler<String>, ResponseWrapper
Constructor and Description |
---|
GetRequest(String uri) |
GetRequest(URI uri) |
Modifier and Type | Method and Description |
---|---|
org.apache.http.HttpResponse |
getHttpResponse() |
String |
getReasonPhrase()
Get reason phrase from response.
|
URI |
getRedirectLocation() |
String |
getResponseBodyAsString() |
org.apache.http.Header |
getResponseHeader(String name) |
int |
getStatusCode()
Get status code from response.
|
String |
handleResponse(org.apache.http.HttpResponse response)
Handle request response and return response as string.
|
getConfig, getProtocolVersion, getRequestLine, getURI, releaseConnection, setConfig, setProtocolVersion, setURI, started, toString
abort, clone, completed, isAborted, reset, setCancellable, setConnectionRequest, setReleaseTrigger
addHeader, addHeader, containsHeader, getAllHeaders, getFirstHeader, getHeaders, getLastHeader, getParams, headerIterator, headerIterator, removeHeader, removeHeaders, setHeader, setHeader, setHeaders, setParams
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getURI
public GetRequest(URI uri)
public GetRequest(String uri)
IllegalArgumentException
- if the uri is invalid.public String handleResponse(org.apache.http.HttpResponse response) throws IOException
handleResponse
in interface org.apache.http.client.ResponseHandler<String>
response
- response objectIOException
- on errorpublic String getResponseBodyAsString() throws IOException
getResponseBodyAsString
in interface ResponseWrapper
IOException
public org.apache.http.Header getResponseHeader(String name)
public int getStatusCode()
getStatusCode
in interface ResponseWrapper
public String getReasonPhrase()
public URI getRedirectLocation()
public org.apache.http.HttpResponse getHttpResponse()
getHttpResponse
in interface ResponseWrapper
Copyright © 2001–2024 MickaĆ«l Guessant. All rights reserved.