request.setResourcePath(resourcePath);
AWS4Signer aws4Signer=new AWS4Signer();
String host = uri.getHost();
aws4Signer.setServiceName(host);
aws4Signer.sign(request, awsCredentials);
//set headers for real request
for (Entry <String, String>entry:request.getHeaders().entrySet()){
conn.setRequestProperty(entry.getKey(),entry.getValue());
}