0

I'm building a web app on Etherlink using Flutter and the library that wraps Ethers.js is called web3dart. Everything else being constant, the request works fine when using an Infura endpoint, but it fails with "415 Unsupported Media Type" when switching to https://node.ghostnet.etherlink.com.

This is the request I'm making. It works fine when using postman but it breaks down in my flutter app:

{"headers:":{"Content-type":"application/json","Accept":"application/json"},"jsonrpc":"2.0","method":"eth_call","params":[{"to":"0x58b19157E0c13FA317cDaF9912DbfC22A156CCAf","data":"0x19ba0b63"},"latest"],"id":1}

In the network tab of dev tools, I can see 415 Unsupported Media Type

1
  • Someone else is reviewing this question at the minute in another forum, I will ask them to post an update here when done. In the meantime, can you check if the content-type thats being sent is actually: Content-Type: application/json; charset=UTF-8. There seems to be an issue found that charset=UTF-8 is behaving unexpectedly and some libraries/languages append this unnecessarily
    – Simon McLoughlin
    May 13 at 13:11

1 Answer 1

0

we've tested the following command:

curl -X POST https://node.ghostnet.etherlink.com \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_call","params":[{"to":"0x58b19157E0c13FA317cDaF9912DbfC22A156CCAf","data":"0x19ba0b63"},"latest"],"id":1}'

and it worked fine, so we need to look deeper into the root of the problem and it's potentially the charset=UTF-8 encoding. This will be feedback to the dev team to fix it.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.