Unable to get transaction with json-rpc command I am trying this command to get transaction from bitvoin 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}


Please help.
You're trying to run code from example, dont do it, try with real transaction id, not from examples.

Examples:
&gt; bitcoin-cli gettransaction "1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d"
&gt; bitcoin-cli gettransaction "1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d" true
&gt; curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "gettransaction", "params": ["1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d"] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/