[Tutor] POST MULTI PART DATA WITH PYTHON

Ajin Abraham ajin25 at gmail.com
Mon May 6 19:05:57 CEST 2013


Hi,
   I was working on a python project that requires to upload an image
using httplib. Here i need to POST a MULTI PART DATA with Python using
inbuilt libraries. I know there are better libraries like requests and
poster. but i need to do it with httplib itself.

I will attach a screenshot==> http://s1.postimg.org/qjjhy445q/file.jpg

So here i think there is some problem with my code that the
'Content-Length is different and i am getting a 404 not found
response. i placed the file "screenshot.png" together with my python
source file.

Here is my source code==>http://bpaste.net/show/V2xbtcBSpYsNbwGPCmFM/

Please tell me what's wrong in my code. and please don't suggest me
other libraries.

Regards,
Ajin Abraham


More information about the Tutor mailing list