'.. http:put:: /downloads
A PUT request to this endpoint will start a download from a provided URI. This URI can either represent a file
location, a magnet link or a HTTP(S) url.
- anon_hops: the number of hops for the anonymous download. 0 hops is equivalent to a plain download
- safe_seeding: whether the seeding of the download should be anonymous or not (0 = off, 1 = on)
- destination: the download destination path of the torrent
- torrent: the URI of the torrent file that should be downloaded. This parameter is required.
**Example request**:
.. sourcecode:: none
curl -X PUT http://localhost:8085/downloads
--data "anon_hops=2&safe_seeding=1&destination=/my/dest/on/disk/&uri=file:/home/me/test.torrent
**Example response**:
.. sourcecode:: javascript
{"started": True, "infohash": "4344503b7e797ebf31582327a5baae35b11bda01"}'

def render_PUT(self, request):

    parameters = http.parse_qs(request.content.read(), 1)
    if (('uri' not in parameters) or (len(parameters['uri']) == 0)):
        request.setResponseCode(http.BAD_REQUEST)
        return json.dumps({'error': 'uri    parameter    missing'})
    (download_config, error) = DownloadsEndpoint.create_dconfig_from_params(parameters)
    if error:
        request.setResponseCode(http.BAD_REQUEST)
        return json.dumps({'error': error})
    def download_added(download):
        request.write(json.dumps({'started': True, 'infohash': download.get_def().get_infohash().encode('hex')}))
        request.finish()
    def on_error(error):
        request.setResponseCode(http.INTERNAL_SERVER_ERROR)
        request.write(json.dumps({'error': error.getErrorMessage()}))
        request.finish()
    download_deferred = self.session.start_download_from_uri(unicode(parameters['uri'][0], 'utf-8'), download_config)
    download_deferred.addCallback(download_added)
    download_deferred.addErrback(on_error)
    return NOT_DONE_YET
