Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
Tags
- IntelliJ
- netsh
- Eclipse
- Windows 10
- profile
- bash
- Source
- find
- ssh
- resource
- GIT
- plugin
- Windows
- lsof
- web.xml
- import
- 네트워크
- 단축키
- JavaScript
- Quartz
- vscode
- xargs
- maVen
- VirtualBox
- grep
- tomcat
- 줄바꿈 문자
- port
- context
- Mac
Archives
- Today
- Total
develog
AsyncHttpClient 본문
import java.util.concurrent.Future;
import com.ning.http.client.AsyncHttpClient;
import com.ning.http.client.AsyncHttpClientConfig;
import com.ning.http.client.Response;
public String send(String url) {
try {
AsyncHttpClientConfig config = new AsyncHttpClientConfig.Builder().setRequestTimeoutInMs(1 * 1000).build();
AsyncHttpClient async = new AsyncHttpClient(config);
Future<Response> future = async.prepareGet(url).execute();
Response response = future.get();
return = response.getResponseBody();
} catch (Exception e) {
return = "";
}
}
'Dev > Java' 카테고리의 다른 글
jndi (0) | 2013.07.18 |
---|---|
template, callback (0) | 2013.07.17 |
StringBuilder, replace (0) | 2013.07.11 |
spring-test-dbunit (0) | 2013.07.09 |
dbunit jar download (0) | 2013.07.09 |
Comments