'How to send byte string as header value in cpprestsdk (C++ REST SDK)

I am trying to send encrypted string (byte data) as header value using cpprestsdk..

I realize that it is not able to understand encrypted byte string as header value and gives me the error: Error: 87 : WinHttpAddRequestHeaders: 87: The parameter is incorrect.

Encrypted string e.g: "«ZáqÏkGk"«ZáqÏkGkr\bør6\x18¤Å(ˆ™HŽB\af=6«ŠÄäi\x1aì"

Now my question is, is there any other way to encode the encrypted string so that it will send the headers across to the server?

I am using AES encryption to encrypt plain text for the header value. I need to send the data in encrypted format to the server and not as plain text and it needs to be sent in the header.

Can anyone throw light on whether there is any way to send the encrypted byte string in header ?



Sources

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

Source: Stack Overflow

Solution Source