Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a Generic python library to consume REST based services? [closed]

Tags:

python

rest

Ok. I want to consume REST based services.

I'd like to use python. In fact, I am going to use python.

The way I'd like to use it is from the command line/ipython, to try out different REST services, with intention of formally coding it later. ( my usage of the REST service not the generic api thing )

I'm looking for a pretty generic, fully featured REST client/API in python. Not bare bones, but plush, nice to use. There are tons of them out there, but I'd kind of like to settle on one and master it.

Any suggestions?

EDIT: This is one:

https://github.com/benoitc/restkit

EDIT: http://pypi.python.org/pypi/requests is exactly it.

EDIT: http://pypi.python.org/pypi/siesta is just as perfect!

like image 686
chiggsy Avatar asked Dec 04 '10 21:12

chiggsy


People also ask

How to consume a REST API in Python?

There are several ways to consume a REST API from Python. However, the easiest way is to utilize the module, requests. Here, we are calling the get method defined in the requests module. The URL will determine what data will be returned back.

What is Restapi in Python?

REST stands for REpresentational State Transfer and is an architectural style used in modern web development. It defines a set or rules/constraints for a web application to send and receive data. In this article, we will build a REST API in Python using the Flask framework.


1 Answers

The problem with having a "plush" REST client library is that REST itself isn't that well-defined. REST, in and of itself, just means that you want to use HTTP standards whenever possible, but other than that, the field is wide open.

Is the data encoded with JSON? What are the URL schemes and what do they mean?

Since REST basically just means HTTP, your best bet is httplib, but I wouldn't describe it as plush.

like image 75
Ken Kinder Avatar answered Sep 20 '22 21:09

Ken Kinder