You can use HttpRequest.BodyPublishers.ofByteArray(...) in stead of ofByteArrays(...) . The Content-Length header will then be set. The only drawback is, that first you will have to join the list of byteArrays into 1 byteArray.