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 | 31 |
Tags
- vscode
- Eclipse
- profile
- xargs
- IntelliJ
- maVen
- grep
- GIT
- netsh
- 네트워크
- resource
- lsof
- Windows
- ssh
- JavaScript
- bash
- web.xml
- port
- plugin
- context
- 단축키
- Windows 10
- Source
- VirtualBox
- Quartz
- 줄바꿈 문자
- import
- tomcat
- find
- 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