I have seen a few posts about how this can be done using oauth, but I need to use basic auth and I can't seem to get it to work. Below is an example of the code I'm using.
<script type="javascript" runat="server">
Platform.Load("core", "1.1.5");
var url = 'https://example.com/';
var contentType = 'application/json';
var header = 'auth=("username", "password")';
var payload = '{';
payload += ' "body":"This is a comment"';
payload += '}';
var result = HTTP.Post(url, contentType, payload, header);
</script>