Permalink
Switch branches/tags
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
126 lines (90 sloc) 2.82 KB

Versions

The versions argument must be a list of names representing the available API versions.

Request example

When no version is specified on the URI request, the default version is the first element off the list, example:

curl -i http://api.zunzun.io/my/ip

Or:

curl -i http://api.zunzun.io/v0/my/ip

The output could be something like:

Now if we change the version, notice the v1:

curl -i http://api.zunzun.io/v1/my/ip

The output could be something like:

How it works internally

The API directory structre looks like:

The directories v0 and v1 have the same structure, but the contents of the .py scripts change.

In this example, v0 returns the IP of the request, while v1 besides returing the IP it also returns the inet_atom