HTTP post with urllib2

Chris Angelico rosuav at gmail.com
Tue Aug 6 20:28:24 EDT 2013


On Tue, Aug 6, 2013 at 11:52 PM, cerr <ron.eggler at gmail.com> wrote:
> ./post.py
> Traceback (most recent call last):
>   File "./post.py", line 13, in <module>
>     response = urllib2.urlopen(req, 120)
>   File "/usr/lib/python2.7/urllib2.py", line 126, in urlopen
>     return _opener.open(url, data, timeout)
>   File "/usr/lib/python2.7/urllib2.py", line 398, in open
>     req = meth(req)
>   File "/usr/lib/python2.7/urllib2.py", line 1116, in do_request_
>     'Content-length', '%d' % len(data))
>
>
> I don't get it, what's going on here?
>

You've given a traceback without the actual error. MRAB happened to
figure out the mistake just from what you posted, but in future, do
try to copy a bit more down :)

ChrisA



More information about the Python-list mailing list