Unexpected char 0x0a in header value when using OkHttp client in Android

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.

Base64.encodeToString(credentials.getBytes(), Base64.NO_WRAP);
this avoids wrapping with a platform specific newline character(s).

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)