I'm trying to bulk load data by hitting the neptune bulk load endpoint:
private void upload(String source) throws URISyntaxException, IOException {
String jsonReq = createJson("s3://" + source);
InputStream inputStream = new ByteArrayInputStream(jsonReq.getBytes(StandardCharsets.UTF_8));
Request<Void> req = new DefaultRequest<>("neptune-db");
req.setHttpMethod(HttpMethodName.POST);
req.setEndpoint(new URI("https", null, HOST, 8182, "/loader", null, null));
req.setContent(inputStream);
req.setHeaders(Map.of("host",
HOST,
"Content-Type",
"application/json",
"x-amz-content-sha256",
"required"));
AWS4Signer signer = new AWS4Signer();
signer.setRegionName(region);
signer.setServiceName(req.getServiceName());
signer.setOverrideDate(new Date());
signer.sign(req, getCreds());
httpClient.requestExecutionBuilder().request(req).errorResponseHandler(new ErrorResponseHandler()).execute();
}
I keep getting 403. The same request works in AWScurl and postman. What could be missing in this case? I can see the tokens getting pulled for the signing.