Re: http post goes into $_REQUEST instead into $_FILES

2013-08-16 Thread Piet van Oostrum
cerr writes: > Hi, > > I have a Python script that is executing an http POST to transfer a file from > the client to the server. I have achieved this with below code: > but my problem is, the data gets posted to the sever but arrives in > the `$_REQUEST` array and I'm expected to post stuff s

Re: HTTP post with urllib2

2013-08-07 Thread cerr
On Tuesday, August 6, 2013 5:14:48 PM UTC-7, MRAB wrote: > On 06/08/2013 23:52, cerr wrote: > > > Hi, > > > > > > Why does this code: > > > > > > #!/usr/bin/python > > > > > > > > > import urllib2 > > > from binascii import hexlify, unhexlify > > > > > > host = "localhost" > > > uri="/t

Re: HTTP post with urllib2

2013-08-06 Thread Chris Angelico
On Tue, Aug 6, 2013 at 11:52 PM, cerr wrote: > ./post.py > Traceback (most recent call last): > File "./post.py", line 13, in > response = urllib2.urlopen(req, 120) > File "/usr/lib/python2.7/urllib2.py", line 126, in urlopen > return _opener.open(url, data, timeout) > File "/usr/li

Re: HTTP post with urllib2

2013-08-06 Thread MRAB
On 06/08/2013 23:52, cerr wrote: Hi, Why does this code: #!/usr/bin/python import urllib2 from binascii import hexlify, unhexlify host = "localhost" uri="/test.php" data ="\x48\x65\x6C\x6C\x6F\x57\x6F\x72\x6C\x64" #Hello World url="http://{0}{1}?f=test".format(host, uri) req = urllib2.Reques

Re: HTTP post with urllib2

2013-08-06 Thread Joel Goldstick
On Tue, Aug 6, 2013 at 7:35 PM, cerr wrote: > On Tuesday, August 6, 2013 4:08:34 PM UTC-7, Joel Goldstick wrote: >> On Tue, Aug 6, 2013 at 6:52 PM, cerr wrote: >> >> > Hi, >> >> > >> >> > Why does this code: >> >> > >> >> > #!/usr/bin/python >> >> > >> >> > >> >> > import urllib2 >> >> > from bin

Re: HTTP post with urllib2

2013-08-06 Thread cerr
On Tuesday, August 6, 2013 4:08:34 PM UTC-7, Joel Goldstick wrote: > On Tue, Aug 6, 2013 at 6:52 PM, cerr wrote: > > > Hi, > > > > > > Why does this code: > > > > > > #!/usr/bin/python > > > > > > > > > import urllib2 > > > from binascii import hexlify, unhexlify > > > > > > host = "loc

Re: HTTP post with urllib2

2013-08-06 Thread Joel Goldstick
On Tue, Aug 6, 2013 at 6:52 PM, cerr wrote: > Hi, > > Why does this code: > > #!/usr/bin/python > > > import urllib2 > from binascii import hexlify, unhexlify > > host = "localhost" > uri="/test.php" > data ="\x48\x65\x6C\x6C\x6F\x57\x6F\x72\x6C\x64" #Hello World > url="http://{0}{1}?f=test".forma

Re: Http post and http get

2012-02-06 Thread n3d!m
Cookies work because I am able to login on website and GET other pages. -- http://mail.python.org/mailman/listinfo/python-list

Re: http post

2010-05-28 Thread yqyq22
On May 28, 5:24 pm, christian schulze wrote: > On 28 Mai, 17:20, yqyq22 wrote: > > > > > > > On May 28, 5:17 pm, christian schulze wrote: > > > > On 28 Mai, 16:47, yqyq22 wrote: > > > > > Hy, i would like to create a little script to reproduce this one > > > > below: > > > > Do you have suggest

Re: http post

2010-05-28 Thread christian schulze
On 28 Mai, 17:20, yqyq22 wrote: > On May 28, 5:17 pm, christian schulze wrote: > > > > > On 28 Mai, 16:47, yqyq22 wrote: > > > > Hy, i would like to create a little script to reproduce this one > > > below: > > > Do you have suggestion? > > > > POST /folder/path/upload.exe?/dir HTTP/1.1 > > > Ho

Re: http post

2010-05-28 Thread yqyq22
On May 28, 5:17 pm, christian schulze wrote: > On 28 Mai, 16:47, yqyq22 wrote: > > > > > > > Hy, i would like to create a little script to reproduce this one > > below: > > Do you have suggestion? > > > POST /folder/path/upload.exe?/dir HTTP/1.1 > > Host: 192.168.100.1:8080 > > User-Agent: Mozill

Re: http post

2010-05-28 Thread christian schulze
On 28 Mai, 16:47, yqyq22 wrote: > Hy, i would like to create a little script to reproduce this one > below: > Do you have suggestion? > > POST /folder/path/upload.exe?/dir HTTP/1.1 > Host: 192.168.100.1:8080 > User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: > 1.9.2.3) Gecko/2010040

Re: HTTP Post Request

2010-05-12 Thread kak...@gmail.com
On May 12, 6:13 am, Kushal Kumaran wrote: > On Tue, May 11, 2010 at 3:59 PM, kak...@gmail.com wrote: > > On May 11, 10:56 am, "kak...@gmail.com" wrote: > >> On May 11, 5:06 am, Kushal Kumaran > >> wrote: > > >> > On Mon, May 10, 2010 at 8:26 PM, kak...@gmail.com > >> > wrote: > >> > > On May

Re: HTTP Post Request

2010-05-11 Thread Kushal Kumaran
On Tue, May 11, 2010 at 3:59 PM, kak...@gmail.com wrote: > On May 11, 10:56 am, "kak...@gmail.com" wrote: >> On May 11, 5:06 am, Kushal Kumaran >> wrote: >> >> >> >> > On Mon, May 10, 2010 at 8:26 PM, kak...@gmail.com wrote: >> > > On May 10, 10:22 am, Kushal Kumaran >> > > wrote: >> > >> On M

Re: HTTP Post Request

2010-05-11 Thread kak...@gmail.com
On May 11, 10:56 am, "kak...@gmail.com" wrote: > On May 11, 5:06 am, Kushal Kumaran > wrote: > > > > > On Mon, May 10, 2010 at 8:26 PM, kak...@gmail.com wrote: > > > On May 10, 10:22 am, Kushal Kumaran > > > wrote: > > >> On Mon, May 10, 2010 at 7:30 PM, kak...@gmail.com > > >> wrote: > > >>

Re: HTTP Post Request

2010-05-11 Thread kak...@gmail.com
On May 11, 5:06 am, Kushal Kumaran wrote: > On Mon, May 10, 2010 at 8:26 PM, kak...@gmail.com wrote: > > On May 10, 10:22 am, Kushal Kumaran > > wrote: > >> On Mon, May 10, 2010 at 7:30 PM, kak...@gmail.com wrote: > >> > Hi to all, i want to ask you a question, concerning the best way to do > >

Re: HTTP Post Request

2010-05-10 Thread Kushal Kumaran
On Mon, May 10, 2010 at 8:26 PM, kak...@gmail.com wrote: > On May 10, 10:22 am, Kushal Kumaran > wrote: >> On Mon, May 10, 2010 at 7:30 PM, kak...@gmail.com wrote: >> > Hi to all, i want to ask you a question, concerning the best way to do >> > the following as a POST request: >> > There is serv

Re: HTTP Post Request

2010-05-10 Thread kak...@gmail.com
On May 10, 10:22 am, Kushal Kumaran wrote: > On Mon, May 10, 2010 at 7:30 PM, kak...@gmail.com wrote: > > Hi to all, i want to ask you a question, concerning the best way to do > > the following as a POST request: > > There is server-servlet that accepts xml commands > > It had the following HTTP

Re: HTTP Post Request

2010-05-10 Thread Kushal Kumaran
On Mon, May 10, 2010 at 7:30 PM, kak...@gmail.com wrote: > Hi to all, i want to ask you a question, concerning the best way to do > the following as a POST request: > There is server-servlet that accepts xml commands > It had the following HTTP request headers: > >            Host: somehost.com >

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

Re: HTTP POST uploading large files

2008-01-20 Thread Wolfgang Draxinger
Paul Rubin wrote: > Wolfgang Draxinger <[EMAIL PROTECTED]> writes: >> Am I just blind for some urllib2/httplib feature, or some >> other library? Or do I really have to fiddle around with >> sockets myself (I hope not...). > > I did something like that by just opening a socket and writing > the >

Re: HTTP POST uploading large files

2008-01-20 Thread Paul Rubin
Wolfgang Draxinger <[EMAIL PROTECTED]> writes: > Am I just blind for some urllib2/httplib feature, or some other > library? Or do I really have to fiddle around with sockets > myself (I hope not...). I did something like that by just opening a socket and writing the stuff with socket.sendall. It'

RE: HTTP POST uploading large files

2008-01-20 Thread Brian Smith
Wolfgang Draxinger wrote: > The problem is, that videos, by nature are rather big files, > however urllib2 wants it's Request objects being prepared > beforehand, which would mean to first load the whole file to memory. Try using mmap. Here is some untested code: map = mmap(file.fileno(

Re: HTTP POST uploading large files

2008-01-19 Thread Gabriel Genellina
En Sat, 19 Jan 2008 21:19:24 -0200, Wolfgang Draxinger <[EMAIL PROTECTED]> escribi�: > I'm thinking about writing a script to upload videos to sites > like YouTube or Google Video, which is usually done by a HTTP > POST. > > The problem is, that videos, by nature are rather big files, > however

Re: http POST only returning GET data

2005-06-24 Thread vm
Benji - that worked like a champ - my mistake. thanks Vinod -- http://mail.python.org/mailman/listinfo/python-list

Re: http POST only returning GET data

2005-06-24 Thread Benji York
vm wrote: > Hi, for some reason my POST is not working properly. Look at the URL again, you missed a character. You had: httpSess.request("POST","/",params,headers) It should be: httpSess.request("POST","/q",params,headers) -- Benji York -- http://mail.python.org/mailman/listinfo/python-lis