According to the specification RFC 7230 (HTTP 1.1):
Historically, HTTP has allowed field content with text in the
ISO-8859-1 charset [ISO-8859-1], supporting other charsets only
through use of [RFC2047] encoding. In practice, most HTTP header
field values use only a subset of the US-ASCII charset [USASCII].
Newly defined header fields SHOULD limit their field values to
US-ASCII octets. A recipient SHOULD treat other octets in field
content (obs-text) as opaque data.
That said, there is a standard HTTP header for credentials, the Authorization
one. You can use the basic authentication and its content would be encoded with base64:
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
The value after Basic
is the encoded value of the string username:password
. For more details about such mechanism, see this link: https://en.wikipedia.org/wiki/Basic_access_authentication.
See also this answer for more details: What encoding should I use for HTTP Basic Authentication?.
Hope it helps you,
Thierry