path¶
path
is the name of the variable containing a list of elements of the URI after
has been parsed.
Suppose the incoming request is:
http://api.zunzun.io/v1/gevent/ip
ZunZun instance will convert it to:
['v1', 'gevent', 'ip']
where:
vroot = default
version = v1
resource = gevent
path = ['ip']
for the incoming request:
http://api.zunzun.io/gevent/aa/bb
this will be generated:
vroot = default
version = v0
resource = gevent
path = ['aa', 'bb']
Example¶
1 2 3 4 5 6 7 8 9 10 11 12 13 | from zunzuncito import tools
class APIResource(object):
def dispatch(self, request, response):
try:
name = request.path[0]
except Exception:
name = ''
return 'Name: ' + name
|
Many thanks Paw - The ultimate REST client for Mac. for supporting Open Source projects.
A great amount of time has been spent creating, crafting and maintaining this software, please consider donating.
Donating helps ensure continued support, development and availability.
comments powered by Disqus