Rest api ẅith python » History » Version 7
Version 6 (Javier Hernandez, 2010-11-09 10:15) → Version 7/18 (Javier Hernandez, 2010-11-09 10:15)
h1. Using the REST API with Python
Here is the two well-known options for using REST API with python.
# "PyActiveResource":http://code.google.com/p/pyactiveresource/
# "Python library":http://code.google.com/p/pyredminews/
h2. *PyActiveResource* example:
<pre>
<code class="python"> <pre code="python">
# Importing pyactiveresource
from pyactiveresource.activeresource import ActiveResource
class Issue(ActiveResource):
_site = 'http://redmine.foo.org'
_user = 'username'
_password = 'password'
# Get issues
issues = Issue.find()
# Get a specific issue, from its id
issue = Issue.find(1345)
# Issue attributes
# Updating an attribute
</pre>
Here is the two well-known options for using REST API with python.
# "PyActiveResource":http://code.google.com/p/pyactiveresource/
# "Python library":http://code.google.com/p/pyredminews/
h2. *PyActiveResource* example:
<pre>
<code class="python"> <pre code="python">
# Importing pyactiveresource
from pyactiveresource.activeresource import ActiveResource
class Issue(ActiveResource):
_site = 'http://redmine.foo.org'
_user = 'username'
_password = 'password'
# Get issues
issues = Issue.find()
# Get a specific issue, from its id
issue = Issue.find(1345)
# Issue attributes
# Updating an attribute
</pre>