From 796d1259264a7b7a0725a395dcb69778e7e67254 Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Fri, 4 Jul 2014 07:59:50 +0200 Subject: Updated README. --- README.rst | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/README.rst b/README.rst index e18a355f..2034b0e0 100644 --- a/README.rst +++ b/README.rst @@ -182,8 +182,8 @@ Add an article: >>> import requests, json >>> headers = {'Content-type': 'application/json', 'Accept': 'application/json'} - >>> payload = {'link': 'http://blog.cedricbonhomme.org/2014/05/24/sortie-de-pyaggr3g470r-5-3/', 'title': 'Sortie de pyAggr3g470r 5.3', 'content':'La page principale de pyAggr3g470r a été améliorée...', 'date':'06/23/2014 11:42 AM'), 'feed_id':'42'} - >>> r = requests.post("https://pyaggr3g470r.herokuapp.com/api/v1.0/articles/0", headers=headers, auth=("your-email", "your-password"), data=json.dumps(payload)) + >>> payload = {'link': 'http://blog.cedricbonhomme.org/2014/05/24/sortie-de-pyaggr3g470r-5-3/', 'title': 'Sortie de pyAggr3g470r 5.3', 'content':'La page principale de pyAggr3g470r a été améliorée...', 'date':'06/23/2014 11:42 AM', 'feed_id':'42'} + >>> r = requests.post("https://pyaggr3g470r.herokuapp.com/api/v1.0/articles", headers=headers, auth=("your-email", "your-password"), data=json.dumps(payload)) >>> print r.content { "message": "ok" @@ -214,7 +214,7 @@ Delete an article: { "message": "ok" } - >>> r = requests.delete("hhttps://pyaggr3g470r.herokuapp.com/api/v1.0/articles/84574", auth=("your-email", "your-password")) + >>> r = requests.delete("https://pyaggr3g470r.herokuapp.com/api/v1.0/articles/84574", auth=("your-email", "your-password")) >>> print r.status_code 404 >>> print r.content @@ -226,17 +226,18 @@ Delete an article: Feeds ''''' +Add a feed: + +.. code:: python + + >>> payload = {'link': 'http://blog.cedricbonhomme.org/feed'} + >>> r = requests.post("https://pyaggr3g470r.herokuapp.com/api/v1.0/feeds", headers=headers, auth=("your-email", "your-password"), data=json.dumps(payload)) + Delete a feed: .. code:: python >>> r = requests.delete("https://pyaggr3g470r.herokuapp.com/api/v1.0/feeds/29", auth=("your-email", "your-password")) - >>> print r.status_code - 200 - >>> print r.content - { - "message": "ok" - } Donation ======== -- cgit