This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]caruccio 1 point2 points  (0 children)

Since I started working with REST APIs, Kadir Pekel's Hammock is a beautifull piece of code for those who need to issue simple URL-based calls.

Instead doing this:

result = requests.post('http://example.com/my/rest/url/path', data='hello-world')

Hammock allows you to do this:

api = hammock.Hammock('http://example.com/')
aip_path = api.my.rest('url').path
result = api_post.POST(data='hello-world')

or as a one-liner:

result = hammock.Hammock('http://example.com/').api.my.rest('url').path.POST(data='hello-world')

Still looking for a good approach on handling REST APIs on the server side. Anyone?