It turns out (a) that the existing Twisted machinery already sets a
`Content-Length' header on `POST' submissions, (b) that it's too stupid
to notice that the caller's already set one, and (c) that nginx rejects
`POST' requests with duplicate `Content-Length' headers with `400 Bad
Request', which turns out to be surprisingly hard to debug.
Signed-off-by: Mark Wooding <mdw@distorted.org.uk>
cl.log(DBG.HTTP_FULL, 'requesting: ' + str(mime))
hh = { 'User-Agent': ['hippotat'],
- 'Content-Type': ['multipart/form-data; boundary="b"'],
- 'Content-Length': [str(len(mime))] }
+ 'Content-Type': ['multipart/form-data; boundary="b"'] }
bytesreader = io.BytesIO(mime)
producer = twisted.web.client.FileBodyProducer(bytesreader)