public class HttpCallerUtil extends Object
Modifier and Type | Field and Description |
---|---|
static org.apache.log4j.Logger |
logger |
static int |
TIME_OUT_REQUESTS |
Constructor and Description |
---|
HttpCallerUtil(String url,
String user,
String password)
Instantiates a new http caller util.
|
Modifier and Type | Method and Description |
---|---|
String |
callGet(String urlMethod,
Map<String,String> parameters)
Call get.
|
String |
callPost(String urlMethod,
String body,
String contentType)
Call post.
|
org.apache.commons.httpclient.HttpClient |
getClient()
Gets the client.
|
String |
getPassword()
Gets the password.
|
String |
getUrlservice()
Gets the urlservice.
|
String |
getUsername()
Gets the username.
|
void |
setClient(org.apache.commons.httpclient.HttpClient client)
Sets the client.
|
void |
setPassword(String password)
Sets the password.
|
void |
setUrlservice(String urlservice)
Sets the urlservice.
|
void |
setUsername(String username)
Sets the username.
|
public static final org.apache.log4j.Logger logger
public static final int TIME_OUT_REQUESTS
public String callGet(String urlMethod, Map<String,String> parameters) throws Exception
urlMethod
- the url methodparameters
- the parametersException
- the exceptionpublic String callPost(String urlMethod, String body, String contentType) throws Exception
urlMethod
- the url methodbody
- the bodycontentType
- the content typeException
- the exceptionpublic String getUrlservice()
public void setUrlservice(String urlservice)
urlservice
- the new urlservicepublic org.apache.commons.httpclient.HttpClient getClient()
public void setClient(org.apache.commons.httpclient.HttpClient client)
client
- the new clientpublic String getUsername()
public void setUsername(String username)
username
- the new usernamepublic String getPassword()
public void setPassword(String password)
password
- the new passwordCopyright © 2016. All Rights Reserved.