move encodeURIComponent to URL Basic auth