[SOLVED] How to upload an image using POST API

One more quick note (which @NigelG’s reference to base64 encoding prompted)…

The base64-encoded image should NOT contain the “data:mimetype;base64” prefix. That’s needed only in the context of a data URL - i.e. only if you intend to store the image data itself directly in the DB so that the image data is part of the URL and thus served with the page source and rendered “inline”.

That could make sense in some situations for relatively small images, but it’s generally not the best way to go for most images.