Skip to content

Instantly share code, notes, and snippets.

@RyanHope
RyanHope / httpRequest.py
Created July 25, 2016 23:33 — forked from lukemarsden/httpRequest.py
Simple function to do an HTTP POST using Twisted Agent
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):