from twisted.web import server, resource
from twisted.internet import reactor
class Simple(resource.Resource):
isLeaf = True
def render_POST(self, request):
print request.content.getvalue()
return request.content.getvalue()
site = server.Site(Simple())
reactor.listenTCP(8080, site)
reactor.run()
On Jan 30, 2017, at 13:47, Kevin Mcintyre <kebin70@gmail.com> wrote:hey all - quick question. Trying to understand FileBodyProducer as it pertains to POST.json_body = FileBodyProducer(StringIO(json.dumps({'key': 'value'}))) agent.request("POST", ~uri, Headers({'User-Agent': ['AkamaiTest']}), json_body)Does the agent chunk the POST body?Maybe!Is this controllable?Not really. The current implementation will certainly use chunked encoding sometimes, but there isn't a strong API guarantee of this anywhere.Any insight appreciated!You probably don't want to try to control this. I believe that proxies are within their rights to mess around with chunk boundaries and re-buffer things, so you don't have any strong guarantees that chunk sizes will be preserved.Why is it that you want to control chunking in the first place?-glyph
_______________________________________________
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted- python