I'm doing the file uploading with the HttpUrlConnection
class.
conn.setRequestMethod("PUT");
conn.setDoOutput(true);
conn.setDoInput(true);
conn.setRequestProperty("Trailer", "Content-Integrity");
conn.setFixedLengthStreamingMode((int) (getSourceSize()-pos));
while ((bytes = in.read(block, 0, DEFAULT_BLOCK_SIZE)) > 0) {
out.write(block, 0, bytes);
}
And after that I need to send the Content-Integrity header like: Content-Integrity: sha-256:bdcf7f645fd53dd3b3763f59376134ff58cc337247c978bdd178b6ccdfbff19f
How can I do this?