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

python page response benchmarking (headers)

How can I get so-to-say page's response time: time between request is sent and the first header's byte comes? PS: Here I don't want to deal with sockets - it would work, but it is too raw. PPS: with curl in bash you can do it like this: (time curl…
Nikita Hismatov
  • 1,546
  • 1
  • 13
  • 30
2
votes
1 answer

Exchange Web Services (EWS) - Exchange 2010 soap calls via suds

Im trying to send an email via Exchange Web Services using suds 0.4.1: import suds from suds.client import Client from suds.transport.https import WindowsHttpAuthenticated url = "file:///C:/Services.wsdl" user = 'domain\\user' password =…
2
votes
3 answers

How to check redirected web page address, without downloading it in Python

For a given url, how can I detect final internet location after HTTP redirects, without downloading final page (e.g. HEAD request.) using python. I am trying to write a mass downloader, my downloading mechanism needs to know internet location of…
yasar
  • 13,158
  • 28
  • 95
  • 160
2
votes
3 answers

Python urllib2 decode chunked encoding

I have the following code to open and read URLs: html_data = urllib2.urlopen(req).read() and I believe this is the most standard way to read data from HTTP. However, when the response have chunked tranfer-encoding, the response starts with the…
dragoon
  • 5,601
  • 5
  • 37
  • 55
2
votes
1 answer

Django/httplib : transmitting request.raw_post_data with httplib

"AAaarg" ! Please HeLp !!! Here is what I am trying to do ... I have a Django site site1, which needs to access the API of another service site2. However, in order to do that, site1 needs to use its own login credentials and stuff ... Therefore I…
sebpiq
  • 7,540
  • 9
  • 52
  • 69
2
votes
2 answers

httplib is not getting all the redirect codes

I am trying to get the final url of a page that seems to redirect more than once. Try this sample URL in your browser and compare it to the final URL at the bottom of my code snippet: Link that redirects more than once And here is the test code I…
Nathan
  • 2,941
  • 6
  • 49
  • 80
2
votes
1 answer

HTTPS request with Python standard library

UPDATE: I managed to do a request with urllib2, but I'm still wondering what is happening here. I would like to do a HTTPS request with Python. This works fine with the requests module, but I don't want to use external dependencies, so I'd like to…
ToonAlfrink
  • 2,501
  • 2
  • 19
  • 19
2
votes
3 answers

POST file in request body to API

I'm trying to upload a file in an API that just says: REQUEST The request body should contain the contents of the file. https://developer.fortnox.se/documentation/resources/inbox/ What I've tried so far: headers = { "Access-Token":…
saturnusringar
  • 149
  • 3
  • 13
2
votes
1 answer

not able to verify ssl-certificate from client side using any of python requests, httplib/httplib2, urllib/urlib2

this question is duplicate. but i am still asking because i am not finding any solution from given answers. so guys don't make it duplicate, instead help me to solve this problem. i am running my server as https using bottle(paste). when trying to…
DON
  • 45
  • 7
2
votes
1 answer

python http lib automatically determine the type of authentication

I have a problem that I known the web services require authentication,but I can't determine Basic or Digest it need,How can I deal with this situation use python2.7 http library that I have own the username and password?
benbusi
  • 117
  • 1
  • 8
2
votes
1 answer

Python httplib.HTTPSConnection with proxy

I would like to send a Get request from python's httplib library, using HTTPS protocol. I have already went through multiple answers suggesting how to do it when using http protocol, but they didn't work with https. here's my code to defile an…
user4516335
2
votes
1 answer

Selenium 2.53.5 httplib.BadStatusLine: '' Python

Im trying to automate the registration of serial numbers in an online form using Selenium 2.53.5 in Python 2.7. The script has been working for 2+ months, but yesterday I started receiving an error right when I go to run it: httplib.BadStatusLine:…
Trey Taylor
  • 103
  • 2
  • 12
2
votes
2 answers

httplib.ResponseNotReady with api.ai

I am trying to make my own chatbot with api.ai. The first time it goes good but then the second time I get this error: Traceback (most recent call last): File "/root/Documents/Projects/Darlene/core/api.py", line 34, in main() …
2
votes
0 answers

incompleteread error: I'm trying to read a spread sheet using gspread

I'm using get_all_values() function which some times throws an error content = worksheet.get_all_values() File "/usr/local/lib/python2.7/dist-packages/gspread/models.py", line 339, in get_all_values cells = self._fetch_cells() File…
ck reddy
  • 494
  • 7
  • 17
2
votes
0 answers

httplib - http not accepting content length

Problem When I switched Macbooks, all of the sudden I am getting an HTTP 411: Length Required (I wasn't getting this using a different Mac) trying to use a POST request with httplib. I cannot seem to find a work around for this. Code Portion 1: from…
MITjanitor
  • 375
  • 1
  • 3
  • 16