public class JaxyClient extends Object
| Modifier and Type | Class and Description |
|---|---|
class |
JaxyClient.SourceCodeGenerator |
| Modifier and Type | Field and Description |
|---|---|
static String |
HTTP_METHOD_GET_METHOD |
static String |
HTTP_METHOD_POST_METHOD |
static String |
HTTPS_ALG_SSL |
static String |
HTTPS_ALG_TLS |
Set<String> |
mForceIndexedParameterNameSet |
| Constructor and Description |
|---|
JaxyClient() |
| Modifier and Type | Method and Description |
|---|---|
void |
addParameter(Map<String,String[]> parameterMap) |
void |
addParameter(String parameterName,
double doubleParameterValue) |
void |
addParameter(String parameterName,
float floatParameterValue) |
void |
addParameter(String parameterName,
int intParameterValue) |
void |
addParameter(String parameterName,
long longParameterValue) |
void |
addParameter(String parameterName,
String parameterValue) |
void |
addParameter(String parameterName,
String[] parameterValue) |
void |
addParameter(String parameterName,
String parameterValue,
boolean isNeedUrlEncodeParameterValue) |
void |
addRequestHeader(String headerName,
String headerValue)
Add header value to http(s) request header
|
String |
doHttpRequest() |
JaxyClient.SourceCodeGenerator |
gen() |
String |
getEncoding() |
String |
getEndpointUrl() |
JsonNode |
getJson()
retrieve json formatted data from network and get as JsonNode
|
JsonNode |
getJson(String jsonText)
Get JsonNode from json formatted file
|
String |
getLatestRequestRawUrl()
returns raw RequestUrl of latest request
|
String |
getLatestRequestUrl() |
protected Map |
getParameterMap() |
String |
getProxyHost() |
String |
getQueryParamString() |
String |
getText()
Get as plain text from network
|
String |
getTextFormUrl(URL url)
retrieve text from net
|
XmlNode |
getXml()
retrieve xml formatted data from network and get as XmlNode
|
XmlNode |
getXml(Document doc)
Deprecated.
|
XmlNode |
getXml(File file)
Get XmlNode from xml formatted file
|
XmlNode |
getXml(String xmlFormattedText)
Transform Xml formatted data into XmlNode
|
XmlNode |
getXml(URL url)
Retrieve xml formatted data from url and get as XmlNode
|
JaxyClient |
setBasicAuthUserNameAndPassword(String userName,
String password)
Set userName and password for BasicAuth
This method is available after calling setUseBasicAuth(boolean)
with 'true' |
void |
setEncoding(String encoding) |
void |
setEndpointUrl(String endpointUrl) |
void |
setForceIndexedParameterName(String parameterName)
Force add the array index into the selected parameterName
|
void |
setHttpMethod(String requestMethod) |
void |
setProxy(String proxyHost,
int proxyPort) |
JaxyClient |
setSSLAlgorithm(String sslAlgorithm) |
JaxyClient |
setTimeoutMillis(int millis) |
JaxyClient |
setUseBasicAuth(boolean useBasicAuth)
Set use http basic auth
|
void |
setUseCDATA(boolean useCDATA) |
void |
setUserAgent(String userAgent)
Add 'User-Agent' into request header
|
public static final String HTTP_METHOD_GET_METHOD
public static final String HTTP_METHOD_POST_METHOD
public static final String HTTPS_ALG_SSL
public static final String HTTPS_ALG_TLS
public JaxyClient setSSLAlgorithm(String sslAlgorithm)
public void setUserAgent(String userAgent)
userAgent - public void addRequestHeader(String headerName, String headerValue)
headerName - headerValue - public JsonNode getJson() throws JaxyClientNetworkException
JaxyClientNetworkExceptionpublic JsonNode getJson(String jsonText)
jsonText - public XmlNode getXml() throws JaxyClientNetworkException
JaxyClientNetworkException@Deprecated public XmlNode getXml(Document doc)
doc - public XmlNode getXml(File file)
file - public XmlNode getXml(URL url) throws JaxyClientNetworkException
url - JaxyClientNetworkExceptionpublic XmlNode getXml(String xmlFormattedText)
xmlFormattedText - public String getText() throws JaxyClientNetworkException
JaxyClientNetworkExceptionpublic JaxyClient setBasicAuthUserNameAndPassword(String userName, String password)
setUseBasicAuth(boolean)
with 'true'userName - password - public JaxyClient setUseBasicAuth(boolean useBasicAuth)
useBasicAuth - public JaxyClient setTimeoutMillis(int millis)
public void setForceIndexedParameterName(String parameterName)
parameterName - protected Map getParameterMap()
public void setHttpMethod(String requestMethod)
public void addParameter(String parameterName, String parameterValue, boolean isNeedUrlEncodeParameterValue)
public void addParameter(String parameterName, int intParameterValue)
public void addParameter(String parameterName, long longParameterValue)
public void addParameter(String parameterName, float floatParameterValue)
public void addParameter(String parameterName, double doubleParameterValue)
public String getTextFormUrl(URL url) throws JaxyClientNetworkException
JaxyClientNetworkExceptionpublic String doHttpRequest() throws JaxyClientNetworkException
JaxyClientNetworkExceptionpublic String getLatestRequestRawUrl()
public String getEncoding()
public void setEncoding(String encoding)
public String getProxyHost()
public void setProxy(String proxyHost, int proxyPort)
public String getEndpointUrl()
public void setEndpointUrl(String endpointUrl)
public void setUseCDATA(boolean useCDATA)
public String getQueryParamString()
public String getLatestRequestUrl()
public JaxyClient.SourceCodeGenerator gen()
Copyright © 2015. All rights reserved.