When sending a Base64 encoded string as header using Http, I am getting error response as
Unexpected char 0x0a at 28 in header value: I99Uy+HjG5PpEhmi8vZgm0W7KDQ=
String encodedHeader = Base64.encodeToString(value.getBytes(), Base64.DEFAULT);
0x0a is a newline character which is forbidden in a header.
Solution would be to make sure that these characters are stripped off before sending the encoded value as header.
this avoids wrapping with a platform specific newline character(s).