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
|
HttpURLConnection |
getConnection() |
int |
getConnectTimeout()
Gets the HTTP Connection timeout
|
String |
getContentType()
Gets the Content Type, 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) |
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)
|
void |
setAccept(String contentType)
Set the content type (Accept header) for the results
|
void |
setAllowDeflate(boolean allow)
Sets whether the HTTP request will include a Accept-Encoding: deflate header
|
void |
setAllowGZip(boolean allow)
Sets whether the HTTP request will include a Accept-Encoding: gzip header
|
void |
setBasicAuthentication(String user,
char[] password)
Sets basic authentication
|
void |
setConnectTimeout(int timeout)
Sets HTTP Connection timeout, any value <= 0 is taken to mean no timeout
|
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 HttpURLConnection getConnection()
public void setAccept(String contentType)
public String getContentType()
setAccept(String)
method)public int getResponseCode()
public void setAllowGZip(boolean allow)
public void setAllowDeflate(boolean allow)
public void setBasicAuthentication(String user, char[] password)
user
- Usernamepassword
- Passwordpublic boolean usesPOST()
public void setForcePOST()
public void setConnectTimeout(int timeout)
public int getConnectTimeout()
public void setReadTimeout(int timeout)
public int getReadTimeout()
public InputStream exec() throws QueryExceptionHTTP
QueryExceptionHTTP
Licenced under the Apache License, Version 2.0