Http authentication

I tried to use the httpDo() with the following code for basic authentication but it is not working, can someone advise on this ?

I got a “Failed to load resource: the server responded with a status of 401 (Unauthorized)” from the server in the console."

apiMetrics = "";

function setup() {
    createCanvas(400, 400)
    var url = apiMetrics;

        url, {
            method: 'GET',
            headers: {
                authorization: 'Basic username:password'
        function (data) {

Is that a valid link? I couldn’t get it to work. If you post this link in your browser, do you get the same error? That would be my first test.


Yes, i removed the actual link…

If I goto the URL manually, I was prompted with username & password and after I login, I get this json data …


Is this solved or are you still inquiring how to do it? Just dbl checking…


No, it is not resolved yet, I still cannot do authorization: 'Basic ’ method yet using httpDo …