'How can i take encrypted data in a byte array and put that into an HTTP request in a binary format using C#

I want to take encrypted data in a byte array and put that into an HTTP request in a binary format. So far I have this code in C#

byte[] encryptedBytes = var encryptor.Encrypt(dataToEncrypt);

HttpRequestMessage newHttpMessage =  new HttpRequestMessage();

newHttpMessage.Content = encryptedBytes;

I have been provided with an example in Javascript, I need to achieve the same but using C#

                $.post({ 
                        url: "xyz",
                        contentType: "application/json",
                        headers: {
                            
                            "Ing-Plain-Content-Length": jsonData.length
                        },
                        data: new Uint8Array(encrypted),
                        processData: false,
                        xhr: function () {
                            return xhrOverride;
                        },
                        dataType: "binary",


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source