public class HttpQuery extends Params
Params.Pair| Modifier and Type | Field and Description |
|---|---|
static int |
urlLimit
The definition of "large" queries
|
| Constructor and Description |
|---|
HttpQuery(String serviceURL)
Create a execution object for a whole model GET
|
HttpQuery(URL url)
Create a execution object for a whole model GET
|
| Modifier and Type | Method and Description |
|---|---|
InputStream |
exec()
Execute the operation
|
org.apache.http.client.HttpClient |
getClient()
Gets the HTTP client that is being used, may be null if no request has yet been made
|
int |
getConnectTimeout()
Gets the HTTP Connection timeout
|
String |
getContentType()
Gets the Content Type
|
org.apache.http.protocol.HttpContext |
getContext()
Gets the HTTP context that is being used, or sets and returns a default
|
int |
getReadTimeout()
Gets the HTTP Read timeout
|
int |
getResponseCode()
Gets the HTTP Response Code returned by the request (returns 0 if request
has yet to be made)
|
String |
getResponseMessage()
Gets the HTTP Response Message returned by the request (returns null if request
has yet to be made)
|
void |
setAccept(String contentType)
Set the content type (Accept header) for the results
|
void |
setAllowCompression(boolean allow)
Sets whether the HTTP request will include compressed encoding
header
|
void |
setClient(org.apache.http.client.HttpClient client)
Sets the client to use
|
void |
setConnectTimeout(int timeout)
Sets HTTP Connection timeout, any value <= 0 is taken to mean no timeout
|
void |
setContext(org.apache.http.protocol.HttpContext context)
Sets the context to use
|
void |
setForcePOST()
Force the use of HTTP POST for the query operation
|
void |
setReadTimeout(int timeout)
Sets HTTP Read timeout, any value <= 0 is taken to mean no timeout
|
String |
toString() |
boolean |
usesPOST()
Return whether this request will go by GET or POST
|
public HttpQuery(String serviceURL)
serviceURL - The modelpublic HttpQuery(URL url)
url - The modelpublic void setAccept(String contentType)
contentType - Accept content typepublic String getContentType()
If the query has been made this reflects the Content-Type header returns,
if it has not been made this reflects only the Accept header that will be
sent (as set via the setAccept(String) method)
public int getResponseCode()
public String getResponseMessage()
public void setAllowCompression(boolean allow)
allow - Whether to allow compressed encodingpublic void setClient(org.apache.http.client.HttpClient client)
client - Clientpublic void setContext(org.apache.http.protocol.HttpContext context)
context - HTTP contextpublic org.apache.http.client.HttpClient getClient()
public org.apache.http.protocol.HttpContext getContext()
HttpContext in scopepublic boolean usesPOST()
public void setForcePOST()
public void setConnectTimeout(int timeout)
timeout - Connection Timeoutpublic int getConnectTimeout()
public void setReadTimeout(int timeout)
timeout - Read Timeoutpublic int getReadTimeout()
public InputStream exec() throws QueryExceptionHTTP
QueryExceptionHTTPLicenced under the Apache License, Version 2.0