added clarity to api_uploader

This commit is contained in:
aldacron 2017-05-18 01:03:30 -07:00
parent 6b465f5324
commit 2449fb96ee
1 changed files with 20 additions and 18 deletions

View File

@ -5,24 +5,26 @@ import json
import requests import requests
''' '''
The POST payload to the api endpoint (/api/upload) should look like this The POST payload to the api endpoint (/api/upload) should be multipart/form-data containing three fields
{
'auth_info': { 'auth_info': file containing "{
'username': str, 'username': str,
'password': str 'password': str
}, }",
'torrent_info': {
'category': str, # see below 'torrent_info': {
'display_name': str, # optional 'category': str, # see below
'information': str, 'display_name': str, # optional
'description': str, 'information': str,
'is_anonymous': boolean, 'description': str,
'is_hidden': boolean, 'is_anonymous': boolean,
'is_remake': boolean, 'is_hidden': boolean,
'is_complete': boolean 'is_remake': boolean,
}, 'is_complete': boolean
'torrent_file': bytes # see below example },
}
'torrent_file': multi part file format
A successful request should return {'Success': int(torrent_id)} A successful request should return {'Success': int(torrent_id)}
A failed request should return {'Failure': ["Failure 1", "Failure 2"...]]} A failed request should return {'Failure': ["Failure 1", "Failure 2"...]]}