Help with api and basic http auth

Hi

Your code is a bit hard to read. Post your code like this:

I think you will need to use something else to for authentication if you are aiming for rest API. Http simple is not really suited for this.