Author: Diego Manenti Martins (Diego.Manenti.Martins)
Date: 2012-04-20 23:13
this code sends data in a different way if using python 2.6 or python 2.7 >>> import urllib2 >>> url = 'http://server.com/post_image?tid=zoV6LJ' >>> f = open('test.jpg') >>> data = f.read() >>> res = urllib2.urlopen(url, data) I checked it with wireshark and the data is sent in a different way when using python 2.7 The code works for python2.5 and python2.6
Author: Diego Manenti Martins (Diego.Manenti.Martins)
Date: 2012-04-21 00:56
It stoped to work. It was working when using with python 2.6 and crashed on switching to python 2.7 I expect the same behavior of curl -X POST http://server.com/post_image?tid=zoV6LJ -T test.jpg
Could you give the proper POST FORM url which you were trying? I could try it in 2.6 and 2.7 and see if there is any difference. Nothing has changed that such low levels like the POST operations by sending of data.