How to implement simple POST, GET, and DELETE in python
<p>Short version: Can I just use the Requests module for POST, GET, and DELETE?</p>

<p>I'm trying to use the Pinterest REST API. (<a href="https://developers.pinterest.com/tools/api-explorer/?" rel="nofollow">Pinterest API Explorer</a>)</p>

<p>I'm going the simple route and just manually got my authentication token via oauth, so basically all I need to know how to do is POST, GET, and DELETE to a specific URL and also include the parameters, then return a json. </p>

<p>I really only need three API functions, list authorized user's followers (GET), follow user (POST), and unfollow user (DELETE). The only param I need for any of those is my access_token that I got manually.</p>

<p>It seems like a simple problem, but there's about 5 python Pinterest API wrappers, none of them complete, some of them not working at all. I've looked at the pycurl, httplib, and requests modules. They all look like they have a simple enough method for GET, but it gets more complicated with POST and maybe DELETE. It seems like it should be super simple, a function that takes a method (POST/GET/DELETE/etc), a url, and a set of parameters, so why is it more complicated than that? If it were that easy, I don't understand why all these API wrappers would be half done since it theoretically should be as simple as calling a function with those 3 parameters (with an array for the 3rd parameter) for every function in the API.</p>

<p>In the Requests python package, there's this function under the RequestMethods class:
def request(self, method, url, fields=None, headers=None, **urlopen_kw)</p>

<p>Looks like I understand everything except what the headers are and the **urlopen_kw, but I think it should work without those to variables, correct?</p>

<p>I'd appreciate it if someone could point me in the right direction.</p>