I am making a POST request to my IPFS node. I am trying to log the results in console. My response is in JSON format. How do I do this? Thanks.
`{Name: "<Random Value here>",…}
Hash: “”
Name: “”
Size: “”`
function upload() {
document.getElementById("loading").innerHTML = `<p>Uploading...</p>`
const reader = new FileReader();
reader.onloadend = function() {
const ipfs = window.IpfsApi('<IP>', 80) // Connect to IPFS
const buf = buffer.Buffer(reader.result) // Convert data into buffer
ipfs.files.add(buf, (err, result) => { // Upload buffer to IPFS
if (err) {
console.error(err)
return
}
console.log([RESULTS HERE])
```