The username and password needs to be encoded and sent in BASE64
So if using username as the username it would become dXNlcm5hbWU= in BASE64 and a password of password would become cGFzc3dvcmQ= in BASE64
You can use this handy BASE64 encoding tool to do the encoding for you.