httpMethod.setRequestHeader(Constants.HDR_VCLOCK, vclock);
}
// Serialize body
if (httpMethod instanceof EntityEnclosingMethod) {
EntityEnclosingMethod entityEnclosingMethod = (EntityEnclosingMethod) httpMethod;
// Any value set using setValueAsStream() has precedent over value
// set using setValue()
if (valueStream != null) {
if (valueStreamLength != null && valueStreamLength >= 0) {
entityEnclosingMethod.setRequestEntity(new InputStreamRequestEntity(valueStream, valueStreamLength,
contentType));
} else {
entityEnclosingMethod.setRequestEntity(new InputStreamRequestEntity(valueStream, contentType));
}
} else if (value != null) {
entityEnclosingMethod.setRequestEntity(new ByteArrayRequestEntity(value, contentType));
} else {
entityEnclosingMethod.setRequestEntity(new ByteArrayRequestEntity("".getBytes(), contentType));
}
}
}