public class HttpUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static String |
doGet(String url)
access given url by get request without retry when exception.
|
static String |
doGet(String url,
int retryTimes)
access given url by get request, if get exception, will retry by given
retryTimes.
|
static String |
doPost(String action,
Map<String,String> parameters)
access given action with given parameters(default encoding by
"UTF-8") by post request without retry when exception.
|
static String |
doPost(String action,
Map<String,String> parameters,
int retryTimes)
access given action with given parameters by post, if get exception, will
retry by given retryTimes.
|
public static String doGet(String url)
url - url to accesspublic static String doGet(String url, int retryTimes)
url - url to accessretryTimes - retry times when get exception.public static String doPost(String action, Map<String,String> parameters)
action - action url to accessparameters - parameters to postpublic static String doPost(String action, Map<String,String> parameters, int retryTimes)
action - action url to accessparameters - parameters to postretryTimes - retry times when get exception.Copyright © 2014. All rights reserved.