The Artima Developer Community
Sponsored Link

Python Answers Forum
HTTP POST problem in python

3 replies on 1 page. Most recent reply: Oct 27, 2005 2:19 PM by Storm To

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 3 replies on 1 page
fatih

Posts: 2
Nickname: gundoganfa
Registered: Apr, 2005

HTTP POST problem in python Posted: Apr 26, 2005 2:55 PM
Reply to this message Reply
Advertisement
hello,
I am trying to login a webpage using HTTP POST method.

assume there is a string in a web page such as
<form action="xxxx" method="yyyy">
I get xxxx and yyyy from the web page(login page).
always yyyy=POST.
then I need to Post password to xxxx and get the answer.
how can I do that? any opinions?


Andy

Posts: 28
Nickname: adn
Registered: Jul, 2004

Re: HTTP POST problem in python Posted: Apr 28, 2005 5:05 AM
Reply to this message Reply
You can use the urllib module to get the contents of web-pages for you (http://docs.python.org/lib/module-urllib.html).

Speifically, look at the functions urlencode and urlopen to create the post data and to get the page.

fatih

Posts: 2
Nickname: gundoganfa
Registered: Apr, 2005

Re: HTTP POST problem in python Posted: May 2, 2005 8:21 AM
Reply to this message Reply
hmm.. I now can login the webpage entering the username and password. I used urlencode but this command's format needs key & keyvalue.

now I need to upload a file to an exe file such on the web page. I am tring to write a script simulating the user behaviours on a web page. I sniffed the post data when I send the file to the system. and there is not a static format.

now I need to post a raw data such as;

"""
____content type: lþaksdfcýhovýh

heyy!!!
why are you trying to post me!!
PLES<html></html>
<body>
</body>
"""

as you see I wanna send a pure string. how can I send this data? all kinds of help are welcome:)

Storm To

Posts: 5
Nickname: storm
Registered: Oct, 2005

Re: HTTP POST problem in python Posted: Oct 27, 2005 2:19 PM
Reply to this message Reply
I used PAMIE to automate WebApp testing for QA in my company.
It worked out great.

http://pamie.sourceforge.net/

Flat View: This topic has 3 replies on 1 page
Topic: Getting IP Address Previous Topic   Next Topic Topic: calling windows dlls from python

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use