aboutsummaryrefslogtreecommitdiff
path: root/documentation
diff options
context:
space:
mode:
authorFrançois Schmidts <francois.schmidts@gmail.com>2015-03-03 23:05:21 +0100
committerFrançois Schmidts <francois.schmidts@gmail.com>2015-03-03 23:05:21 +0100
commit8e515cbf172f1aa7da37882fc3973f5a2dd70dd0 (patch)
treeae0a275bf82c62eca621a020a0e6ac1f6928e6d3 /documentation
parentfixing documentation for the new (diff)
downloadnewspipe-8e515cbf172f1aa7da37882fc3973f5a2dd70dd0.tar.gz
newspipe-8e515cbf172f1aa7da37882fc3973f5a2dd70dd0.tar.bz2
newspipe-8e515cbf172f1aa7da37882fc3973f5a2dd70dd0.zip
last fixes
Diffstat (limited to 'documentation')
-rw-r--r--documentation/web-services.rst14
1 files changed, 11 insertions, 3 deletions
diff --git a/documentation/web-services.rst b/documentation/web-services.rst
index d7a1b6aa..16a425ad 100644
--- a/documentation/web-services.rst
+++ b/documentation/web-services.rst
@@ -7,15 +7,23 @@ Articles
.. code-block:: python
>>> import requests, json
- >>> r = requests.get("https://pyaggr3g470r.herokuapp.com/api/v2.0/articles",
+ >>> r = requests.get("https://pyaggr3g470r.herokuapp.com/api/v2.0/article/1s",
+ ... headers={'Content-type': 'application/json'},
... auth=("your-nickname", "your-password"))
>>> r.status_code
200 # OK
>>> rjson = r.json()
- >>> rjson[0]["title"]
+ >>> rjson["title"]
'Sponsors required for KDE code sprint in Randa'
- >>> rjson[0]["date"]
+ >>> rjson["date"]
'Wed, 18 Jun 2014 14:25:18 GMT'
+ >>> r = requests.get("https://pyaggr3g470r.herokuapp.com/api/v2.0/article/1s",
+ ... headers={'Content-type': 'application/json'},
+ ... auth=("your-nickname", "your-password"),
+ ... data=json.dumps({'id__in': [1, 2]}))
+ >>> r.json()
+ [{'id': 1, 'title': 'article1', [...]},
+ {'id': 2, 'title': 'article2', [...]}]
Add an article:
bgstack15