我目前正在开发一个与XRPL集成的快照。然而,当我想从被波及的服务器上获取数据时,我遇到了一个问题。
这是我调用的网址:POST https://s.altnet.rippletest.net:51234
这是我的有效载荷
{
"method": "account_info",
"params": [
{
"account": "rDtBYnfg4ehGdYKg98GbxPK63w2rWzYUpT",
"ledger_index": "current",
}
]
}我总是在说Failed to fetch时出错,我正在打这样的电话:
const response = await fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
redirect: 'follow',
body: JSON.stringify(payload),
});还有来自snap清单的初始权限:
"initialPermissions": {
"snap_confirm": {},
"snap_manageState": {},
"endowment:network-access": {}
},我总是会犯以下错误:
{
"code": -32603,
"message": "Failed to fetch",
"data": {
"originalError": {}
}
}发布于 2022-11-11 09:44:02
您的JSON数据无效。
{
"method": "account_info",
"params": [
{
"account": "rDtBYnfg4ehGdYKg98GbxPK63w2rWzYUpT",
"ledger_index": "current",
}
]
}应改为
{
"method": "account_info",
"params": [
{
"account": "rDtBYnfg4ehGdYKg98GbxPK63w2rWzYUpT",
"ledger_index": "current"
}
]
}(注意"ledger_index": "current"后面的",“(逗号))
那么,这应该是可行的:)
https://stackoverflow.com/questions/74090660
复制相似问题