Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Kasun Thennakoon tmkasun

🏠
Working from home
View GitHub Profile
@lukemarsden
lukemarsden / httpRequest.py
Created Feb 27, 2011
Simple function to do an HTTP POST using Twisted Agent
View httpRequest.py
from twisted.web.iweb import IBodyProducer
from twisted.internet import defer
from twisted.web.client import Agent
from twisted.web.http_headers import Headers
import urllib
class StringProducer(object):
implements(IBodyProducer)
def __init__(self, body):