https://github.com/etuzon/java-http-client
>HTTP/HTTPS client which support sync and async requests
https://github.com/etuzon/java-http-client
Last synced: 10 months ago
JSON representation
>HTTP/HTTPS client which support sync and async requests
- Host: GitHub
- URL: https://github.com/etuzon/java-http-client
- Owner: etuzon
- Created: 2020-01-07T21:36:32.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-03-06T19:37:16.000Z (almost 6 years ago)
- Last Synced: 2025-01-25T22:21:16.274Z (11 months ago)
- Language: Java
- Size: 104 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
HTTP Client
HTTP/HTTPS client support synced and asynced requests.
Example of synced request:
HttpClient httpClient = initHttpClient(HTTP_ADDRESS);
HttpObject httpObject = null;
try {
httpObject = httpClient.sendGet();
} catch (HttpException | InvalidHttpRequestException e) {
throw new AutomationUnitTestException(e);
}
Example of asynced request:
HttpClient httpClient = initHttpClient(HTTP_ADDRESS);
HttpAsyncClient asyncHttpClient = null;
try {
asyncHttpClient = httpClient.sendAsyncGet("get");
} catch (HttpException | InvalidHttpRequestException e) {
throw new AutomationUnitTestException(e);
}
private HttpClient initHttpClient(String url) throws AutomationUnitTestException {
try {
return new HttpClient(url);
} catch (Exception e) {
throw new AutomationUnitTestException(e);
}
}