I can't upload an image to IPFS through ipfs.blockfrost.io/api/v0/ipfs/add from browser. I am trying to upload image dircetly from frontend of my application (browser extension). I get this response:

"statusCode": 500,
"error": "Internal Server Error",
"message": "Converting circular structure to JSON\n    --> starting at object with constructor 'Socket'\n    |     property 'parser' -> object with constructor 'HTTPParser'\n    --- property 'socket' closes the circle"

When I try to do the same request from node.js server everything is fine. I use the same fetch call on both front and back:

let add = await fetch('https://ipfs.blockfrost.io/api/v0/ipfs/add', {
method: 'POST',
headers: {
'project_id': 'ipfsP0t7F3zOIIl6Op5fpM3c2q3CBYyYa7em'
body: form

It seems like there is a problem on blockfrost's server side with parsing additional headers that browser adds. Or is this behaviour intentional and I shouldn't be able to send requests from frontend? Then the error seems uninformative.

Has anybody faced a similar problem?



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.