How to pass profile username/password as a global variables to Basic Authentication for a REST API

I know the code above looks poor.

Perhaps you had better stay there as KS has a few more problems for WS testing: