When using the Bitbucket Api 2.0 to GET/POST an image inside the repo.
I get the following from my axios request, it seems to be the binary of the image
https://api.bitbucket.org/2.0/repositories/{workspace}/{repo}/src/master/blue-dot-logo.png
How do i decode this to be able to see in my project. Would like to turn it into base64 so I can do the following. Ive attempted multiple methods but nothing able to display the image correctly.
<img src="data:image/png;base64, {base64here}" />
Same thing with committing images to Bitbucket repo. Im using
https://api.bitbucket.org/2.0/repositories/{workspace}/{repo}/src
with a Content-Type": "application/x-www-form-urlencoded
What content do I have to send, blobs, buffers, and image binarys dont work.
and the body like so…
let data = qs.stringify({
[pathtofile]: {filehere},
message: commitMsg,
branch: branch,
});
I have read the documentation and other topics all of the internet but honestly there is not much on this. In the documentation, even the body that needed to be sent, took me forever to figure out what the POST for commits wanted. I could use real help that shows how to do this step by step. Thank you