Unsupported protocol scheme \"\""

Greetings

Spent the last couple of days to post an image using this doco Data Uploads but I keep running into this issue

unsupported protocol scheme \"\""

This is what I got for the code

up top of my ts file I have

const img = open('llamma.png', 'b');

Then later on I do

        const uploadUrl = `upload/api`;
        const fd = new FormData();
        fd.append('name', { data: "file" });
        fd.append('file', http.file(img, imageName, 'image/png'));
        
        const result2 = http.post(uploadUrl, fd.body());
    

I am stuck. Any hints as to what I could be doing wrong?

THanks!

well I see that fd.body() is null. Let me dig in on that issue then

all set! the issue was I was not giving http.post what it needed.

thanks

1 Like