json-rpc of bitcoin not working for testnet(curl command) I am trying this command to get transaction from bitcoin testnet:

curl  --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "gettransaction", "params": ["txId"] }' -H 'content-type: text/plain;' http://username:password@IP:PORT/


And i am getting following error

{ "result":null, "error":{"code" :-32601, "message" : "Method not found"}, id:curltext}
You're passing invalid transaction to the gettransaction method.