Re: HTTP POST File without cURL

2009-09-11 Thread Tim Roberts
John Giotta wrote: > >Is there a verbose feature for urllib2.urlopen? You have the full source code for the module right in front of you. Bringing up urllib2.py in an editor is quicker than waiting for a newsgroup reply. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://ma

Re: HTTP POST File without cURL

2009-09-11 Thread John Giotta
Is there a verbose feature for urllib2.urlopen? Here is my python snippet for posted the file: req = urllib2.Request(url='https://%s%s' % (host, selector), data=open('test.zip', 'rb').read()) req.add_header('content-type', 'application/zip') req.add_header('Authorization', 'Basic %s' % self.auth)

Re: HTTP POST File without cURL

2009-09-09 Thread Jarkko Torppa
On 2009-09-09, John D Giotta wrote: > I'm working with an API that allows me to POST a zip file via HTTP and > the documentation uses a cURL example. cURL works, but when I try to > POST the file via python it fails. > I don't want to use cURL (since I'm trying to be transparent and > dependency-l

Re: HTTP POST File without cURL

2009-09-09 Thread David Stanek
On Wed, Sep 9, 2009 at 1:57 PM, John D Giotta wrote: > I'm working with an API that allows me to POST a zip file via HTTP and > the documentation uses a cURL example. cURL works, but when I try to > POST the file via python it fails. > I don't want to use cURL (since I'm trying to be transparent an

HTTP POST File without cURL

2009-09-09 Thread John D Giotta
I'm working with an API that allows me to POST a zip file via HTTP and the documentation uses a cURL example. cURL works, but when I try to POST the file via python it fails. I don't want to use cURL (since I'm trying to be transparent and dependency-less), but I can't find anything online that wor