Why is it giving 400 bad request for the following code. We want to schedule a torrent using web API of utorrent.
import urllib2, base64
username = "username"
password = "password"
request = urllib2.Request("http://<my_ip>:<torrent_webapi_port>/gui/?action=add-url&s=%s" % urllib2.quote("http://torcache.net/torrent/CDADFE86960C3255EB37B15F7E45C281F3A3C937.torrent?title=[kickass.to]arrow.s02e14.hdtv.x264.lol.ettv"))
base64string = base64.encodestring('%s:%s' % (username, password)).replace('\n', '')
request.add_header("Authorization", "Basic %s" % base64string)
result = urllib2.urlopen(request)
print result.read()