Questions tagged [httplib]

A module from Python standard lib that defines classes which implement the client side of the HTTP and HTTPS protocols.

Official Python documentation at http://docs.python.org/2/library/httplib.html

328 questions
0
votes
0 answers

HTTP code 204 using httplib

I'm writing a python program to access an HTTPS web page using the httplib module, and am having trouble retrieving a message body from the URL. Here is my example code: username = "user" password = "pass" auth = base64.encodestring("%s:%s" %…
Jon Martin
  • 3,252
  • 5
  • 29
  • 45
0
votes
1 answer

Unable to connect to secure website using mechanize in Python

I'm trying to open a secure (https) website using mechanize library in Python. When I try to access the website, the server closes the connection and exception BadStatusLine is raised. I have tried to modify the headers using the addheaders…
Catpro
  • 11
  • 2
0
votes
2 answers

Why can't I view updates to a label while making an HTTP request in Python

I have this code : def on_btn_login_clicked(self, widget): email = self.log_email.get_text() passw = self.log_pass.get_text() self.lbl_status.set_text("Connecting ...") params = urllib.urlencode({'@log_email': email, '@log_pass':…
Rami Dabain
  • 4,709
  • 12
  • 62
  • 106
0
votes
1 answer

Simple Python HTTP Post not accepting parameters....is something serverside stopping me?

I'm having some trouble trying to write a basic webscraper for a Minecraft server site. I'm pretty new to python (but fluent in C/java/.net) and can't seem to get the damn thing to work. I'm trying to reach…
P4r0dy
  • 49
  • 7
0
votes
1 answer

HTTPResponse instance has no attribute 'status_code' in python/django

I have used python httplib to implement REST api to connect with Django tastypie. But whenever i try to get the status code it is showing following error AttributeError at /actions/login HTTPResponse instance has no attribute 'status_code' My code…
hangman
  • 865
  • 5
  • 20
  • 31
0
votes
1 answer

Python httplib POST request and proper formatting

I'm currently working on a automated way to interface with a database website that has RESTful webservices installed. I am having issues with figure out the proper formatting of how to properly send the requests listed in the following site using…
Val Gorbunov
  • 1
  • 1
  • 1
0
votes
0 answers

Pickling a httplib.HTTPMessage fails <1% of the time for URLs with spaces

In Python 2.7.2 pickling a httplib.HTTPMessage works literally more than 99% of the times. But sometimes on rare occasions, it fails: dumps(info) TypeError: can't pickle StringO objects dumps(info, 2) PicklingError: Can't pickle
Petter
  • 37,121
  • 7
  • 47
  • 62
0
votes
1 answer

Broken POST in httplib

I'm having trouble with a POST using httplib. Here is the code: import base64 import urllib import httplib http = urllib3.PoolManager() head = {"Authorization":"Basic %s" % base64.encodestring("foo:bar")} fields =…
aterrel
  • 1,992
  • 1
  • 14
  • 23
0
votes
2 answers

Attach csv file to django request

I would like to add batch with csv file to a job in salesforce.com, according to docs. I use the following code to do that, but it does not work (no new objects appear in salesforce): headers = { 'Content-Type': 'text/csv;…
szaman
  • 6,666
  • 13
  • 53
  • 81
-1
votes
2 answers

Selenium Firefox headless running issue in python

I am getting this error for my python script. I am trying to use selenium firefox headlessly. any solution please ? Traceback (most recent call last): File "myextractor.py", line 297, in testweb_myextractor.Run() File…
rhb
  • 1
-1
votes
2 answers

Formatting httplib response (json)

After some research I was able to get data via RESTful API from a networking device: if sys.version_info >= (2,7,9): import ssl conn = httplib.HTTPSConnection('192.168.158.136', 443, context=ssl._create_unverified_context()) else: conn =…
f0rd42
  • 1,429
  • 4
  • 19
  • 30
-2
votes
2 answers

httplib python error

I'm trying to send an http get request via the httplib, but I'm facing issues. conn = httplib.HTTPConnection("10.30.111.13/View") conn.request("GET", "/Default.aspx") res = conn.getresponse() if res.status == 200: …
guiomie
  • 4,988
  • 6
  • 37
  • 67
-2
votes
2 answers

What is the difference between import httplib and from httplib import *?

I would like to know which is the difference between import httplib and from httplib import * By the way i am using python 2.73.
ND Andy
  • 7
  • 2
1 2 3
21
22