Modifying position of the switch and this.authorization.basic_user was replaced to this.authorization.password for the basic option

I just moved all the switch after open the XMLHttpRequest, also that the this.authorization.basic_user was replaced to  this.authorization.password for the 'basic' option inside the switch