jclouds-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paya, Ashkan" <Ashkan.P...@dell.com>
Subject HTTP Headers
Date Thu, 10 Nov 2016 21:27:45 GMT

Can we use/overwrite HTTP headers such as USER_AGENT when invoking methods like BlobStore.putBlob()
or we need to specify the BlobRequestSigner and use HttpClient instead?
For example, if I want to include the HTTP headers in the following operation:

ByteSource input = ByteSource.wrap(“BLAH”.getBytes(StandardCharsets.UTF_8));

 Blob blob = blobStore







 blobStore.putBlob(container, blob);

Should I use the BlobRequestSigner as follows? Is this the right approach?

 final BlobRequestSigner signer = blobStoreInfo.getBlobRequestSigner();

 HttpRequest request = signer.signPutBlob(container, blob)




    .addHeader(HttpHeaders.USER_AGENT, “custom agent")



 HttpClient httpClient = blobStore.getContext().utils().http());


Thank you,
View raw message