From 8e515cbf172f1aa7da37882fc3973f5a2dd70dd0 Mon Sep 17 00:00:00 2001 From: François Schmidts Date: Tue, 3 Mar 2015 23:05:21 +0100 Subject: last fixes --- documentation/web-services.rst | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'documentation/web-services.rst') 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: -- cgit