rpc "torrent-get" help
rpc "torrent-get" help
I keep getting an error whenever I try to use torrent-get via POST (no method-name) and GET (no fields supplied). I am able to get all the other RPC methods to work.
Re: rpc "torrent-get" help
Could you post to the forum an example of the JSON torrent-get request you're POSTing to Transmission?
Re: rpc "torrent-get" help
right now, i've just beein trying to get it to work using curl.
Code: Select all
curl -d "method=torrent-get" localhost:8081/transmission/rpc
{
"arguments": {},
"result": "no method name"
}
curl localhost:8080/transmission/rpc?method=torrent-get
{
"arguments": {
"torrents": []
},
"result": "no fields specified"
}
curl localhost:8080/transmission/rpc?method=torrent-get?fields=name
{
"arguments": {
"torrents": []
},
"result": "no fields specified"
}
Re: rpc "torrent-get" help
The method name needs to be in the JSON, not in the http headers. This is true for all the requests.
Re: rpc "torrent-get" help
i'm trying to create a greasemonkey script and am able to add a torrent using this:
and when i try to use torrent-get, doesn't work:
Code: Select all
var addstring = "/transmission/rpc?method=torrent-add&filename=" + window.findhrefs(event.target) + "";
GM_xmlhttpRequest({
method: 'GET',
url: server + addstring,
onload: function(responseDetails) {
alert ( "Torrent Added" );
}
});
Code: Select all
var rpcstring="/transmission/rpc?method=torrent-get";
GM_xmlhttpRequest({
method: 'GET',
url: server+rpcstring,
onload: function(responseDetails) {
alert (responseDetails.responseText);
}
});
Re: rpc "torrent-get" help
Things will go a lot easier if you POST json requests instead of using the GET hack.
Actually I'm hoping someone will write a rison-to-json parser in C that we can send more sophisticated requests via GET. But until that happens... POST is your friend...
Actually I'm hoping someone will write a rison-to-json parser in C that we can send more sophisticated requests via GET. But until that happens... POST is your friend...