473,594 Members | 2,756 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Https Form Page

I'm new on this httplib and urllib. Actually I dont know what should i use.

I want to fill the form in a "https" page , and return the result . I
write a test code but always gives errors. I cant find any good
example about this on the net. What should I do about this ?
import urlparse,urllib ,httplib,string ,htmllib,format ter

#port="443"
target="https://www.abc.com/"
params = urllib.urlencod e({'spam': 1, 'eggs': 2, 'bacon': 0})
http=httplib.HT TP("https://www.abc.com/",443)

data='Name=x&Ad ress=x'
headers = {"Content-type":
"applicatio n/x-www-form-urlencoded","Ac cept": "text/plain"}

print "Sending Data On "+target+"...\n "
http.putrequest ("POST",target+ "/xxx.asp?q=7&b=1 1",params)

response = http.getrespons e()
print response.status , response.reason

http.send(data)

code,msg,header s = http.getreply()

print "HTTP Code : ",str(code)
print "HTTP Connection : ",msg
print "HTTP headers : \n",headers,"\n "

HTML=http.getfi le().read()
MyParser=htmlli b.HTMLParser(fo rmatter.NullFor matter())
MyParser.feed(H TML)
# Print all the anchors from the results page
print MyParser.anchor list
Jul 18 '05 #1
1 1884
Hasan D <py*******@gmai l.com> wrote:

I'm new on this httplib and urllib. Actually I dont know what should i use.

I want to fill the form in a "https" page , and return the result . I
write a test code but always gives errors. I cant find any good
example about this on the net. What should I do about this ?

import urlparse,urllib ,httplib,string ,htmllib,format ter

#port="443"
target="http s://www.abc.com/"
params = urllib.urlencod e({'spam': 1, 'eggs': 2, 'bacon': 0})
http=httplib.H TTP("https://www.abc.com/",443)


If you want https, you should use the HTTPS class.

http = httplib.HTTPS(" https://www.abc.com/",443)

Or, even better, the HTTPSConnection class.

http://www.noah.org/python/https/
--
- Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.
Jul 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2183
by: dave | last post by:
Hello I have one simple form (myform.asp) and it posts to query.asp I had put below code in both file on top of the page to redirect this two pages in https:// so any one can access it thru http , it changes to https:// if Request.ServerVariables("HTTPS") = "off" then method = Request.ServerVariables("REQUEST_METHOD") srvname = Request.ServerVariables("SERVER_NAME") scrname = Request.ServerVariables("SCRIPT_NAME") sRedirect = "https://"...
2
2631
by: Mark Delon | last post by:
Hi, i want to log via python script to https page: 'https://brokerjet.ecetra.com/at/' # But it does not work. I am using following code(see below)
3
1687
by: muttu2244 | last post by:
Hi all, Am trying to read a email ids which will be in the form of links ( on which if we click, they will redirect to outlook with their respective email ids). And these links are in the HTTPS page, a secured http page. The point is that am able to read some links with HTTP page, but am not able to read the same when I try with HTTPS.
7
1845
by: Masahiro Ito | last post by:
I need to be login to several websites and download files that are https connections. I just tried IPWorks demo, but it does not seem to offer https. Does anyone know an https capable product, or a way I can do this myself? Thank you. Masahiro
6
4259
by: chris | last post by:
Client page: <input type="file".....> Server: Apache, OC4J, J2EE app XP, SP1 and updates Works perfectly under HTTP. However, under HTTPS the user needs to hit the submit button really fast to avoid a "page cannot be displayed". All other interaction with the application works well.
12
1889
by: Wilhelm Kutting | last post by:
Hello, i got a little understanding Problem. on some http-Sites i can log into my Account with Name/Passwort. The Form-Login-Page ist only http with form action directing to a "secure" https page. So - in my understanding the username and password is send uncrypted over the Net. Only the later Communication is done secure. Am i right that only a https login-Form-page would be safe?
6
1649
by: hpatel | last post by:
Hi, I maintain a website for my organization. Recently, for a login page, I started using HTTPS. It works fine with HTTPS. The problem I face is : When a user goes to login page, he sees the login page via HTTPS. Now, if user doesn't submit the login form but chooses to browse some other link on the same page, that page will still be shown using HTTPS because links are relative. This increases unnecessary HTTPS traffic on the server.
1
5340
gregerly
by: gregerly | last post by:
I've got a question regarding how AJAX calls are handled over HTTPS pages. On my site, I've got a signup form that collects credit card info. It's a three part form, 1. Enter personal Info 2. Enter credit card info 3. Confirmation. I'm handling the different steps with AJAX. So, you land on an https page that has you enter your personal info and click continue. An ajax request is performed and the data is saved to the server, and the credit...
2
4116
by: bizt | last post by:
Hi, I have a page that makes many XmlHttpRequest requests from a single page. This works fine but I need some requests to be made over a secure connection. To my understanding, when setting the location of the path to the file to fetch during the XmlHttpRequest request it has to the be the path relative to the web page such as /secret.php and NOT a full URL such as https://www.example.com/secret.php .. is this about the general idea??...
0
7876
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8372
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8003
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8234
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
3859
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3897
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2385
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1478
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1210
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.