This is a HTTP API example authenticating with Basic Auth. It's also making use of leveraging external Javascript - in this case for base64 en/decoding. Last but not least, it's encapsulating the Basic Authentication functionality into a dedicated class.
Since this example makes use of external Javascript, it won't run in the Wing Playground yet.
Please make sure to use a current and working setup of the wing cli
wing it
wing test --debug main.w