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
8
votes
1 answer

How do I post unicode characters using httplib?

I try to post unicode data with the httplib.request function: s = u"עברית" data = """ %s """ % s con =…
iTayb
  • 12,373
  • 24
  • 81
  • 135
7
votes
4 answers

How do I post non-ASCII characters using httplib when content-type is "application/xml"

I've implemented a Pivotal Tracker API module in Python 2.7. The Pivotal Tracker API expects POST data to be an XML document and "application/xml" to be the content type. My code uses urlib/httplib to post the document as shown: request =…
Matthew Gertner
  • 4,487
  • 2
  • 32
  • 54
7
votes
3 answers

Python httplib and POST

I am currently working with a piece of code that has been written by somebody else. It uses httplib to make requests to server. It has all the data supplied in a correct format - for example message body, header values, etc. The problem is that each…
julx
  • 8,694
  • 6
  • 47
  • 86
7
votes
2 answers

python urllib2 timing

I'd like to collect statistics related to how long each phase of a web request takes. httplib offers: def run(self): conn = httplib.HTTPConnection('www.example.com') start = time.time() conn.request('GET', '/') request_time =…
user1367401
  • 1,030
  • 17
  • 26
7
votes
2 answers

What is the maximum debuglevel for a Python httplib

These docs do not say what the maximum debug level is. I need to know that.
Terrence Brannon
  • 4,760
  • 7
  • 42
  • 61
7
votes
1 answer

"Missing redirect_uri parameter" response from Facebook with Python/Django

This is probably a very dumb question, but I have been staring at this for hours and can't find what I'm doing wrong. I am trying to use Python to authenticate with the Facebook API, but am having issues requesting a user access token. After…
user1462558
  • 111
  • 1
  • 1
  • 4
6
votes
2 answers

Permanent gaierror 'Temporary failure in name resolution' after running for a few hours

I have a long running python script, launched with upstart. This script makes quite a lot of requests. Everything works well at first, however after a few hours I start permanently getting the following error for each request: File…
lipka
  • 1,162
  • 11
  • 19
6
votes
2 answers

selenium chrome driver httplib.badstatusline

I install selenium, chrome, pyvritualdisplay and xvfb using the following tutorial: https://christopher.su/2015/selenium-chromedriver-ubuntu/ when i try to run a python selenium script i get this error when i call webdriver.Chrome() I'm using…
6
votes
2 answers

How to make httplib debugger infomation into logger debug level

By default httplib debug send, headers and reply information returns as logger.info, Instead can how do i display send, headers and replay as part of Debug information? import requests import logging import httplib httplib.HTTPConnection.debuglevel…
Mallikarjunarao Kosuri
  • 1,023
  • 7
  • 25
  • 52
6
votes
0 answers

Errno 104 Connection reset by peer` error

I have following code snippet. Previously it was working fine and was printing output But after now when i did change my machine's phisical loaction location within same network I get error: [Errno 104] Connection reset by peer error IP is same for…
Nikhil Rupanawar
  • 4,061
  • 10
  • 35
  • 51
5
votes
3 answers

How to handle timeouts with httplib (python 2.6)?

I'm using httplib to access an api over https and need to build in exception handling in the event that the api is down. Here's an example connection: connection = httplib.HTTPSConnection('non-existent-api.com', timeout=1) connection.request('POST',…
ryonlife
  • 6,563
  • 14
  • 51
  • 64
5
votes
2 answers

How to set trust-store used by Python's httplib?

Per default, Python's httplib.HTTPSConnection is using the system's trust store to validate a HTTPS certificate. (How) is it possible to set a different CA list to do the validation, replacing the default one? I tried to set the SSLContext used by…
Stefan
  • 171
  • 1
  • 13
5
votes
1 answer

HTTPConnection.request not respecting timeout?

I'm trying to use HTTPConnection (2.7.8) to make a request and I've set the timeout to 10 with HTTPConnection(host, timeout=10). However, HTTPConnection.request() doesn't seem to timeout after 10 seconds. In fact, HTTPConnection.timeout doesn't even…
Kar
  • 6,063
  • 7
  • 53
  • 82
5
votes
2 answers

Error using httlib's HTTPSConnection with PKCS#12 certificate

I'm trying to use httplib's HTTPSConnection for client validation, using a PKCS #12 certificate. I know the certificate is good, as I can connect to the server using it in MSIE and Firefox. Here's my connect function (the certificate includes the…
Remi Despres-Smyth
  • 4,173
  • 3
  • 36
  • 46
5
votes
2 answers

TypeError: is not JSON serializable

I'm trying to make a connection to this website "android-review.googlesource.com" through "httplib.HTTPSConnection" which actually is Gerrit (a tool for reviewing code), Gerrit API provides an interface to JSON formatted review data. I need to…
star2014
  • 173
  • 2
  • 5
  • 14
1 2
3
21 22