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

http post goes into $_REQUEST instead into $_FILES

2013-08-15 Thread cerr
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: from binascii import hexlify, unhexlify from httplib import HTTPConnection, HTTPException import os import hashlib import socket import urllib2

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

HTTP post with urllib2

2013-08-06 Thread cerr
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.Request(url, data,{'Content-Type': 'appli

Re: Python HTTP POST

2013-07-18 Thread Sivaram Neelakantan
On Thu, Jul 18 2013,Joel Goldstick wrote: [snipped 28 lines] > > Many people find urllib and urllib2 to be confusing. There is a module > called requests which makes this stuff a lot easier. ymmv > > http://docs.python-requests.org/en/latest/ Yes, please use this instead of the url* ones, eas

Re: Python HTTP POST

2013-07-17 Thread alex23
On 18/07/2013 4:49 AM, Matt Graves wrote: How would I submit a python HTTP POST request to... for example, go to google.com, enter "Pie" into the search box and submit (Search) Other replies have suggested how you could do it by building the request yourself. Another approach is t

Re: Python HTTP POST

2013-07-17 Thread Joel Goldstick
On Wed, Jul 17, 2013 at 4:15 PM, John Gordon wrote: > In <00ec2f9b-fcae-428c-8932-163e653dd...@googlegroups.com> Matt Graves < > tunacu...@gmail.com> writes: > > > How would I submit a python HTTP POST request to... for example, go to > > google.com, enter &qu

Re: Python HTTP POST

2013-07-17 Thread John Gordon
In <00ec2f9b-fcae-428c-8932-163e653dd...@googlegroups.com> Matt Graves writes: > How would I submit a python HTTP POST request to... for example, go to > google.com, enter "Pie" into the search box and submit (Search) Something like this: import urllib import urllib2 #

Python HTTP POST

2013-07-17 Thread Matt Graves
I am going to be creating a python script that will make filling in information at my job easier. I have all of the information I need... I guess I just need to see it in practice to fully grasp it. How would I submit a python HTTP POST request to... for example, go to google.com, enter &quo

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: Google Chart API, HTTP POST request format.

2011-01-06 Thread Tim Harig
On 2011-01-06, Chris Rebert wrote: > On Wed, Jan 5, 2011 at 11:21 PM, Garland Fulton wrote: >> On Wed, Jan 5, 2011 at 7:26 PM, Tim Harig wrote: >>>    Python 3.1.2 (r312:79147, Oct  9 2010, 00:16:06) >>>    [GCC 4.4.4] on linux2 >>>    Type "help", "copyright", "credits" or "license" for more in

Re: Google Chart API, HTTP POST request format.

2011-01-06 Thread Chris Rebert
On Wed, Jan 5, 2011 at 11:21 PM, Garland Fulton wrote: > On Wed, Jan 5, 2011 at 7:26 PM, Tim Harig wrote: >> >> On 2011-01-06, Slie wrote: >> [reformated to <80 columns per RFC 1855 guidelines] >> > I have read several examples on python post requests but I'm not sure >> > mine needs to be that

Re: Google Chart API, HTTP POST request format.

2011-01-05 Thread Garland Fulton
On Wed, Jan 5, 2011 at 7:26 PM, Tim Harig wrote: > On 2011-01-06, Slie wrote: > [reformated to <80 columns per RFC 1855 guidelines] > > I have read several examples on python post requests but I'm not sure > > mine needs to be that complicated. > > >From the HTML example on the page you posted:

Re: Google Chart API, HTTP POST request format.

2011-01-05 Thread Garland Fulton
On Wed, Jan 5, 2011 at 7:52 PM, Chris Rebert wrote: > On Wed, Jan 5, 2011 at 7:36 PM, Slie wrote: > > > > http://code.google.com/apis/chart/docs/post_requests.html > > > > Google will return a chart in your browser from a URL that you have > built. If your URL is bigger then 2K characters it wil

Re: Google Chart API, HTTP POST request format.

2011-01-05 Thread Chris Rebert
> On Wed, Jan 5, 2011 at 7:52 PM, Chris Rebert wrote: >> On Wed, Jan 5, 2011 at 7:36 PM, Slie wrote: >> > >> > http://code.google.com/apis/chart/docs/post_requests.html >> > >> > Google will return a chart in your browser from a URL that you have >> > built. If your URL is bigger then 2K characte

Re: Google Chart API, HTTP POST request format.

2011-01-05 Thread Corey Richardson
On 01/06/2011 12:16 AM, Garland Fulton wrote: > I tried to use "pygooglechart.py" and I have been trying to get it set > up all day actually along with several other graphing API's. > > I just found out that there is a problem with numpy and python 3.1 that > is why I moved from the API's. Should

Re: Google Chart API, HTTP POST request format.

2011-01-05 Thread Garland Fulton
Thank you for showing me the POST request, I will defiantly learn a lot from that. On Wed, Jan 5, 2011 at 7:26 PM, Tim Harig wrote: > On 2011-01-06, Slie wrote: > [reformated to <80 columns per RFC 1855 guidelines] > > I have read several examples on python post requests but I'm not sure > > mi

Re: Google Chart API, HTTP POST request format.

2011-01-05 Thread Garland Fulton
I tried to use "pygooglechart.py" and I have been trying to get it set up all day actually along with several other graphing API's. I just found out that there is a problem with numpy and python 3.1 that is why I moved from the API's. Should I change version just for these library's? Should I be

Re: Google Chart API, HTTP POST request format.

2011-01-05 Thread Chris Rebert
On Wed, Jan 5, 2011 at 7:36 PM, Slie wrote: > > http://code.google.com/apis/chart/docs/post_requests.html > > Google will return a chart in your browser from a URL that you have built. If > your URL is bigger then 2K characters it will allow you to submit POST > requests. > > They gives examples

Re: Google Chart API, HTTP POST request format.

2011-01-05 Thread Tim Harig
On 2011-01-06, Slie wrote: [reformated to <80 columns per RFC 1855 guidelines] > I have read several examples on python post requests but I'm not sure > mine needs to be that complicated. >From the HTML example on the page you posted:

Google Chart API, HTTP POST request format.

2011-01-05 Thread Slie
http://code.google.com/apis/chart/docs/post_requests.html Google will return a chart in your browser from a URL that you have built. If your URL is bigger then 2K characters it will allow you to submit POST requests. They gives examples of HTML, JavaScript, and PHP POST requests. Is there a way

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 >

HTTP Post Request

2010-05-10 Thread kak...@gmail.com
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 User-Agent: Jakarta Commons-HttpClient Content

Re: python and http POST

2010-02-13 Thread galileo228
Thank you all for your responses, and Javier thank you for your longer response. I've just downloaded mechanize and beautifulsoup and will start to play around. >From a pure learning standpoint, however, I'd really like to learn how to use the python post method (without mechanize) to go to a webp

Re: python and http POST

2010-02-13 Thread galileo228
Thank you all for your responses, and Javier thank you for your longer response. I've just downloaded mechanize and beautifulsoup and will start to play around. >From a pure learning standpoint, however, I'd really like to learn how to use the python post method (without mechanize) to go to a webp

Re: python and http POST

2010-02-13 Thread galileo228
Thank you all for your responses, and Javier thank you for your longer response. I've just downloaded mechanize and beautifulsoup and will start to play around. >From a pure learning standpoint, however, I'd really like to learn how to use the python post method (without mechanize) to go to a webp

Re: python and http POST

2010-02-12 Thread Javier Collado
Hello, I haven't used httplib2, but you can certainly use any other alternative to send HTTP requests: - urllib/urllib2 - mechanize With regard to how do you find the form you're looking for, you may: - create the HTTP request on your own with urllib2. To find out what variables do you need to po

Re: python and http POST

2010-02-11 Thread Terry Reedy
On 2/11/2010 2:11 PM, galileo228 wrote: Hey All, Been teaching myself Python for a few weeks, and am trying to write a program that will go to a url, enter a string in one of the search fields, submit the search, and return the contents of the search result. I'm using httplib2. My two particul

Re: python and http POST

2010-02-11 Thread Ken Seehart
"Use tamperdata to view and modify HTTP/HTTPS headers and post parameters... " https://addons.mozilla.org/en-US/firefox/addon/966 Enjoy, Ken galileo228 wrote: Hey All, Been teaching myself Python for a few weeks, and am trying to write a program that will go to a url, enter a string in one o

python and http POST

2010-02-11 Thread galileo228
Hey All, Been teaching myself Python for a few weeks, and am trying to write a program that will go to a url, enter a string in one of the search fields, submit the search, and return the contents of the search result. I'm using httplib2. My two particular questions: 1) When I set my 'body' var

Re: Trouble sending / receiving compressed data (using zlib) as HTTP POST to server (in django)

2009-10-05 Thread subeen
Thanks for your response. > How did you post the data? If you post binary data you should indicate > this with a proper mime type, like application/octet-stream. Otherwise > it might be interpreted as text which it isn't. > -- I am trying to send the data using following code: ... opener = urll

Re: Trouble sending / receiving compressed data (using zlib) as HTTP POST to server (in django)

2009-10-03 Thread Piet van Oostrum
> subeen (s) wrote: >s> Hi, >s> I am trying to send compressed data to a server written in django. But >s> it shows error while decompressing the data in the server. After some >s> experiment I found that the server is not receiving the exact data I >s> am sending. >s> data = 'hello, this is

Trouble sending / receiving compressed data (using zlib) as HTTP POST to server (in django)

2009-10-03 Thread subeen
Hi, I am trying to send compressed data to a server written in django. But it shows error while decompressing the data in the server. After some experiment I found that the server is not receiving the exact data I am sending. data = 'hello, this is a test message this is another message' data = z

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

Re: logging outgoing HTTP POST message and incoming response message

2009-07-22 Thread Gabriel Genellina
En Wed, 22 Jul 2009 18:18:37 -0300, scriptlear...@gmail.com escribió: On Jul 22, 1:54 pm, "Diez B. Roggisch" wrote: You can use proxy-tools such as tcpmon or sniff traffic using wireshark. Thanks, but I am trying to enable some debug mode to log all outgoing and incoming messages for certain

Re: logging outgoing HTTP POST message and incoming response message

2009-07-22 Thread scriptlear...@gmail.com
On Jul 22, 1:54 pm, "Diez B. Roggisch" wrote: > You can use proxy-tools such as tcpmon or sniff traffic using wireshark. > > Diez Thanks, but I am trying to enable some debug mode to log all outgoing and incoming messages for certain period of time, and running another proxy-tool is not very idea

Re: logging outgoing HTTP POST message and incoming response message

2009-07-22 Thread Diez B. Roggisch
scriptlear...@gmail.com schrieb: I am sending a HTTP POST by using the following codes: opener = urllib2.build_opener(proxyHandler, MultipartPostHandler) params = { "audio" : "http://sample.com/my.wav";, "data" : open(file, "rb") } print opener.open(myUR

logging outgoing HTTP POST message and incoming response message

2009-07-22 Thread scriptlear...@gmail.com
I am sending a HTTP POST by using the following codes: opener = urllib2.build_opener(proxyHandler, MultipartPostHandler) params = { "audio" : "http://sample.com/my.wav";, "data" : open(file, "rb") } print opener.open(myURL, params).read() How do I

RE: PYTHON HTTP POST WORKING EXAMPLE NEEDED

2009-01-23 Thread bruce
PM To: python-list@python.org Subject: Re: PYTHON HTTP POST WORKING EXAMPLE NEEDED Whatever scumbag would rate a new python's users with one start for asking us for help is a complete low-life. Keep acting like that and Python will fade away into the darkness forever. dhaval, Don't let

Re: PYTHON HTTP POST WORKING EXAMPLE NEEDED

2009-01-23 Thread Benjamin Kaplan
On Fri, Jan 23, 2009 at 8:02 PM, r wrote: > Whatever scumbag would rate a new python's users with one start for > asking us for help is a complete low-life. Keep acting like that and > Python will fade away into the darkness forever. Could you please explain where these stars you keep talking

Re: PYTHON HTTP POST WORKING EXAMPLE NEEDED

2009-01-14 Thread Diez B. Roggisch
dhaval wrote: > On Jan 14, 4:11 pm, dhaval wrote: >> Hi, >> >> Can someone please give me an example of a working python post? >> for example using the sitehttp://www.cookiemag.com/ >> >> Thanks in advance, >> Dhaval > > I have tried to look at the code at > http://code.activestate.com/recipes/1

Re: PYTHON HTTP POST WORKING EXAMPLE NEEDED

2009-01-14 Thread dhaval
On Jan 14, 4:11 pm, dhaval wrote: > Hi, > > Can someone please give me an example of a working python post? > for example using the sitehttp://www.cookiemag.com/ > > Thanks in advance, > Dhaval I have tried to look at the code at http://code.activestate.com/recipes/146306/ I can't make any sense

PYTHON HTTP POST WORKING EXAMPLE NEEDED

2009-01-14 Thread dhaval
Hi, Can someone please give me an example of a working python post? for example using the site http://www.cookiemag.com/ Thanks in advance, Dhaval -- http://mail.python.org/mailman/listinfo/python-list

Re: PYTHON HTTP POST

2009-01-14 Thread dhaval
f Mozilla > headers = { > 'User-Agent': 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; > rv:1.9.0.4) Gecko/2008102920 Firefox/3.0.4', > 'Content-Type': content_type > } > h.request('POST', selector, body, headers

Re: PYTHON HTTP POST

2009-01-14 Thread koranthala
5.1; en-US; > rv:1.9.0.4) Gecko/2008102920 Firefox/3.0.4', >         'Content-Type': content_type >         } >     h.request('POST', selector, body, headers) >     res = h.getresponse() >     return res.status, res.reason, res.read() > > Please note th

Re: PYTHON HTTP POST

2009-01-14 Thread koranthala
0.4) Gecko/2008102920 Firefox/3.0.4', 'Content-Type': content_type } h.request('POST', selector, body, headers) res = h.getresponse() return res.status, res.reason, res.read() Please note that you can use multipart whether or not files are there

PYTHON HTTP POST

2009-01-14 Thread lilanidhaval
Hi, I need one complete example of how to do a http post to any site. I have tried making a POST to google but all I am returned with is a 405 error. I don't want to use Pygoogle as I want to try and do this with other sites. I am also having problems inputing with the param I have

Re: Posting File as a parameter to PHP/HTML using HTTP POST

2008-12-02 Thread S.Selvam Siva
ilename="newurl-ideas.txt",name="uploadedfile") > On Tue, Dec 2, 2008 at 1:33 PM, S.Selvam Siva <[EMAIL PROTECTED]>wrote: > I am trying to post file from python to php using HTTP POST method. I tried > mechanize but not able to pass the file object. >

Posting File as a parameter to PHP/HTML using HTTP POST

2008-12-02 Thread S.Selvam Siva
I am trying to post file from python to php using HTTP POST method. I tried mechanize but not able to pass the file object. from mechanize import Browser br=Browser() response=br.open("http://localhost/test.php";) br.select_form('form1') br['uploadedfile']=open(&

Re: Sending multi-part MIME package via HTTP-POST

2008-11-04 Thread Justin Ezequiel
have you tried using the def request(self, method, url, body=None, headers={}) method instead of putrequest, endheaders, send methods? where body is --===1845688244== Content-Type: application/vnd.cip4-jmf+xml MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-ID: beginning

Re: Sending multi-part MIME package via HTTP-POST

2008-11-04 Thread [EMAIL PROTECTED]
Sadly, there is no way to increase the log verbosity. On Oct 17, 2:42 am, Lawrence D'Oliveiro <[EMAIL PROTECTED] central.gen.new_zealand> wrote: > In message > <[EMAIL PROTECTED]>, > > > > [EMAIL PROTECTED] wrote: > > On Oct 15, 2:42 am, Lawrence D'Oliveiro <[EMAIL PROTECTED] > > central.gen.new_z

Re: Sending multi-part MIME package via HTTP-POST

2008-10-17 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > On Oct 15, 2:42 am, Lawrence D'Oliveiro <[EMAIL PROTECTED] > central.gen.new_zealand> wrote: > >> In message >> <[EMAIL PROTECTED]>, >> >> [EMAIL PROTECTED] wrote: >> > ... but I'm getting a very vague server error message ... >> >> Which

Re: Sending multi-part MIME package via HTTP-POST

2008-10-15 Thread [EMAIL PROTECTED]
On Oct 15, 2:42 am, Lawrence D'Oliveiro <[EMAIL PROTECTED] central.gen.new_zealand> wrote: > In message > <[EMAIL PROTECTED]>, > > [EMAIL PROTECTED] wrote: > > ... but I'm getting a very vague server error message ... > > Which is? In this case it's not really something that will be readily recogn

Re: Sending multi-part MIME package via HTTP-POST

2008-10-15 Thread Steve Holden
Lawrence D'Oliveiro wrote: > In message > <[EMAIL PROTECTED]>, > [EMAIL PROTECTED] wrote: > >> ... but I'm getting a very vague server error message ... > > Which is? > very vague ... -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC http://www.holdenweb.com/

Re: Sending multi-part MIME package via HTTP-POST

2008-10-14 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > ... but I'm getting a very vague server error message ... Which is? -- http://mail.python.org/mailman/listinfo/python-list

Sending multi-part MIME package via HTTP-POST

2008-10-13 Thread [EMAIL PROTECTED]
This has got me somewhat stumped, so I'll throw it up here in hopes that someone has ran into this before. I'm trying to send a MIME package to Esko Backstage. I'm a bit confused as to how to send this to the server in a manner that it'll be able to get and de-code the MIME package in a valid way.

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 r

HTTP POST uploading large files

2008-01-19 Thread Wolfgang Draxinger
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 urllib2 wants it's Request objects being prepared beforehand, which would mean to firs

Re: A best approach to a creating specified http post body

2007-05-18 Thread Facundo Batista
[EMAIL PROTECTED] wrote: > Hmm, I guess I meant something different by using "body"- I meant > request data part and not the thing sent in ulr string. You should specify better what you need yes. See, to send POST information in an http request, you can do the following... >>> urllib2.urlopen(m

Re: A best approach to a creating specified http post body

2007-05-18 Thread dzawer
On May 18, 4:57 pm, "Dave Borne" <[EMAIL PROTECTED]> wrote: > > I need to build a special http post body that consists of : > > name=value +\r\n strings. > > Problem is that depending on operations the number of name,value > > pairs can increase and decrea

Re: A best approach to a creating specified http post body

2007-05-18 Thread Shane Geiger
Why not use scotch.recorder? Dave Borne wrote: I need to build a special http post body that consists of : name=value +\r\n strings. Problem is that depending on operations the number of name,value pairs can increase and decrease. Values need to be initialized at runtime, so storing premade

Re: A best approach to a creating specified http post body

2007-05-18 Thread Dave Borne
> I need to build a special http post body that consists of : > name=value +\r\n strings. > Problem is that depending on operations the number of name,value > pairs can increase and decrease. > Values need to be initialized at runtime, so storing premade text > files is not

A best approach to a creating specified http post body

2007-05-18 Thread dzawer
Hi all, I'm rather new to python but not exaclty without programming experience and not quite get best pyhton practices. I have a following problem that it seems I cannot find a way to solve correctly. I need to build a special http post body that consists of : name=value +\r\n strings. Pr

Re: Python to PHP Login System (HTTP Post)

2006-06-24 Thread John J. Lee
[EMAIL PROTECTED] (John J. Lee) writes: [...] > #--- > import mechanize > > SHOW_COOKIES = True > > br = mechanize.Browser() > if SHOW_COOKIES: > cj = mechanize.CookieJar() > br.set_cookiejar(cj) > br.open("http://www.magnetshare.com/main.php";) > br.select_for

Re: Python to PHP Login System (HTTP Post)

2006-06-24 Thread test
On Sat, 24 Jun 2006 01:28:29 GMT, [EMAIL PROTECTED] (John J. Lee) wrote: >[EMAIL PROTECTED] writes: > >> On 22 Jun 2006 16:19:50 -0700, "Justin Azoff" >> <[EMAIL PROTECTED]> wrote: >> >> >Jeethu Rao wrote: >> >> You need to use httplib. >> >> http://docs.python.org/lib/httplib-examples.html >> >

Re: Python to PHP Login System (HTTP Post)

2006-06-23 Thread John J. Lee
[EMAIL PROTECTED] writes: > On 22 Jun 2006 16:19:50 -0700, "Justin Azoff" > <[EMAIL PROTECTED]> wrote: > > >Jeethu Rao wrote: > >> You need to use httplib. > >> http://docs.python.org/lib/httplib-examples.html > >> > >> Jeethu Rao > > > >Not at all. They need to read the documentation for urrli

Re: Python to PHP Login System (HTTP Post)

2006-06-22 Thread test
On 22 Jun 2006 16:19:50 -0700, "Justin Azoff" <[EMAIL PROTECTED]> wrote: >Jeethu Rao wrote: >> You need to use httplib. >> http://docs.python.org/lib/httplib-examples.html >> >> Jeethu Rao > >Not at all. They need to read the documentation for urrlib: > >http://docs.python.org/lib/module-urllib.

Re: Python to PHP Login System (HTTP Post)

2006-06-22 Thread Justin Azoff
Jeethu Rao wrote: > You need to use httplib. > http://docs.python.org/lib/httplib-examples.html > > Jeethu Rao Not at all. They need to read the documentation for urrlib: http://docs.python.org/lib/module-urllib.html http://docs.python.org/lib/node483.html "The following example uses the "POST"

Re: Python to PHP Login System (HTTP Post)

2006-06-22 Thread Jeethu Rao
You need to use httplib. http://docs.python.org/lib/httplib-examples.html Jeethu Rao -- http://mail.python.org/mailman/listinfo/python-list

Python to PHP Login System (HTTP Post)

2006-06-21 Thread test
Hi everyone, I'm creating a desktop Python application that requires web-based authentication for accessing additional application features. HTTP GET is really simple. HTTP POST is not (at least for me anyway);) I have tried a few different sources, but I cannot get HTTP PO

Re: Convert dictionary to HTTP POST

2006-03-05 Thread Laszlo Zsolt Nagy
>>The values of some inputs are encoded using html entities. >>How can I decode a string like "Bessy's cat" in "Bessy's cat"? >> >> > >this snippet might help: > >http://effbot.org/zone/re-sub.htm#strip-html > > Thank you, worked like a charm. :-) Laszlo -- http://mail.python.org/m

Re: Convert dictionary to HTTP POST

2006-03-03 Thread Fredrik Lundh
Laszlo Zsolt Nagy wrote: > The values of some inputs are encoded using html entities. > How can I decode a string like "Bessy's cat" in "Bessy's cat"? this snippet might help: http://effbot.org/zone/re-sub.htm#strip-html -- http://mail.python.org/mailman/listinfo/python-list

Re: Convert dictionary to HTTP POST

2006-03-03 Thread Kent Johnson
Laszlo Zsolt Nagy wrote: > The values of some inputs are encoded using html entities. > How can I decode a string like "Bessy's cat" in "Bessy's cat"? http://groups.google.com/group/comp.lang.python/browse_frm/thread/819731a536a4c1a2/fce6c2f6c3d46e9c?q=htmlentitydefs&rnum=2#fce6c2f6c3d46e9c Kent

Re: Convert dictionary to HTTP POST

2006-03-03 Thread Laszlo Zsolt Nagy
> Well I don't understand what's encoding the apostrophe as an encoded > entity anyway. That's only supposed to be done for HTML content, not > form content. You are right. I was wrong. The problem was not with quote. It was reading out the VALUE of an INPUT from HTML source. > How about an

Re: Convert dictionary to HTTP POST

2006-03-03 Thread Sybren Stuvel
Laszlo Zsolt Nagy enlightened us with: > The values of some inputs are encoded using html entities. How can > I decode a string like "Bessy's cat" in "Bessy's cat"? This should help: http://docs.python.org/lib/module-htmlentitydefs.html Sybren -- The problem with the world is stupidity. Not sa

Re: Convert dictionary to HTTP POST

2006-03-03 Thread Steve Holden
[copied to list] Laszlo Zsolt Nagy wrote: >> >> >> See urllib.urlencode(). No idea why they don't include it in urllib2 >> as well, but there you go. >> >> >>> from urllib import urlencode >> >>> urlencode({'a':'& "Simple string"', 'b': '<>[EMAIL PROTECTED]&*()_+='}) >> 'a=%26+%22Simple+string%22

Re: Convert dictionary to HTTP POST

2006-03-03 Thread Laszlo Zsolt Nagy
> > >See urllib.urlencode(). No idea why they don't include it in urllib2 as >well, but there you go. > > >>> from urllib import urlencode > >>> urlencode({'a':'& "Simple string"', 'b': '<>[EMAIL PROTECTED]&*()_+='}) >'a=%26+%22Simple+string%22&b=%3C%3E%21%40%23%24%25%5E%26%2A%28%29_%2B%3D' > >>>

Re: Convert dictionary to HTTP POST

2006-03-03 Thread Steve Holden
Laszlo Zsolt Nagy wrote: > Hello, > > How can I convert a dictionary into a HTTP POST string? > I have an example below, but this is not working correctly for special > characters. (" ' and others). In other words, if I use "Bessy's cat" > instead

  1   2   >