use of com.aliyuncs.http.HttpRequest in project aliyun-oss-java-sdk by aliyun.
the class HttpCredentialsFetcher method fetch.
@Override
public Credentials fetch() throws ClientException {
URL url = buildUrl();
HttpRequest request = new HttpRequest(url.toString());
request.setMethod(MethodType.GET);
request.setConnectTimeout(AuthUtils.DEFAULT_HTTP_SOCKET_TIMEOUT_IN_MILLISECONDS);
request.setReadTimeout(AuthUtils.DEFAULT_HTTP_SOCKET_TIMEOUT_IN_MILLISECONDS);
HttpResponse response = null;
try {
response = send(request);
} catch (IOException e) {
throw new ClientException("CredentialsFetcher.fetch exception: " + e);
}
return parse(response);
}
Aggregations