pycurl/pycurl — pull request #31 by p (2013-09-26 01:59:30+00:00)
Title: Adds support for libcurl's BUFFER and BUFFERPTR form parameters.

This allows one to use a string as a POST parameter.

Example usage:

...
params = [
('x', (pycurl.FORM_BUFFER, "filename", pycurl.FORM_BUFFERPTR, "data"))
]
c = pycurl.Curl()
c.setopt(pycurl.HTTPPOST, params)
...

Although the API docs say that the buffer should not be freed
until curl_easy_cleanup() is called, I followed the liveness of
CurlObject.httppost within pycurl.c, since the API makes identical
assumptions.

https://sourceforge.net/p/pycurl/patches/9/