Closed jjmiranda closed 6 years ago
I think the problem is this new header: 'X-IOTA-API-Version: 1.4.1' This version thrown the error: curl -s http://localhost:14265 -X POST -H 'Content-Type: application/json' -d '{"command": "getNodeInfo"}' {"error":"Invalid API Version","duration":0} This version its OK: curl -s http://localhost:14265 -X POST -H 'X-IOTA-API-Version: 1.4.1' -H 'Content-Type: application/json' -d '{"command": "getNodeInfo"}'
Thanks for your time to implement this solution!
The problem is not here man :) ! The problem is here: https://github.com/iotaledger/iota.lib.js/blob/master/lib/utils/makeRequest.js add "request.setRequestHeader('X-IOTA-API-Version','1.4.1');" at line 34 👍
Hi Juan,
So is this a problem with iota.lib.js? Could you please raise the issue there and close this one?
BR Akash
Hi! How to apply the fix? Should I reinstall ipm from the git instead from npmjs?
Just published the latest version. Please uninstall the previous version before updating the newer.
sudo npm uninstall iota-pm && sudo npm install -g iota-pm
same (problem) on version 1.4.2.1, here is what works fine :
curl -s http://localhost:14265 -X POST -H 'X-IOTA-API-Version: 1.4.2.1' -H 'Content-Type: application/json' -d '{"command": "getNodeInfo"}'
Thrown this error: Error: Request Error: Invalid API Version at Object.requestError (/usr/lib/node_modules/iota-pm/node_modules/iota.lib.js/lib/errors/requestErrors.js:11:12)
Thanks for your time on this wonderful tool. Send to you more MIOTAS for your excellent work!