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

How to measure RTT using python httplib, Httpserver

I made an HTTP proxy using the httplib and BaseHTTPServer, Now I want to know if there is way that I can calculate the RTT to each server. I don't want to use ping method because I want to calculate the RTT for each object's server passing through…
0
votes
1 answer

Python/Linux - Manually installing httplib2 as a non-root user

I am trying to manually install httplib2 as a non-root user on a Linux machine. The reason I am doing it manually is because I do not have the permissions to install pip. I downloaded the httplib2-0.9.2.tar.gz file from…
activelearner
  • 7,055
  • 20
  • 53
  • 94
0
votes
1 answer

Google serves its homepage to urllib2 when a local search is made

When a local search is done on Google, then the user clicks on the 'More ...' link below the map, the user is then brought to a page such as this. If the URL: https://www.google.com/ncr#q=chiropractors%2BNew+York,+NY&rflfq=1&rlha=0&tbm=lcl is…
Pyderman
  • 14,809
  • 13
  • 61
  • 106
0
votes
1 answer

Help with HTML parsing and sending requests to a web server

I'm working on a small project and I've run into a small problem. The script I have needs to fetch a website and find a specific value in the source HTML file. The value is like this: id='elementID'>
0
votes
1 answer

cx_freeze + selenium + python 3 : No module named 'httplib'

Im trying to buld my app with selenium, i have this setup.py: import sys from cx_Freeze import setup, Executable path_drivers = ( "C:\Python34\Lib\site-packages\PyQt5\plugins\sqldrivers\qsqlmysql.dll", "sqldrivers\qsqlmysql.dll" ) includes =…
0
votes
2 answers

follow redirect using urllib2

I am trying to follow the redirect of a url using urllib2. >>> import urllib2 >>> page=urllib2.urlopen('http://acer.com') >>> print…
Ashish Gupta
  • 2,574
  • 2
  • 29
  • 58
0
votes
1 answer

How to check http status code in python version agnostic way?

I'm writing python code that should run both with python 2.7 and 3.3+ I'm trying to figure out a way to properly check for http status codes and don't reduce my test coverage %. if I write something like: try: import http.client as…
Giovanni Di Milia
  • 13,480
  • 13
  • 55
  • 67
0
votes
0 answers

What is the reason for response not ready error in Mining Social web?

import httplib2 import json import apiclient.discovery # pip install google-api-python-client # XXX: Enter any person's name Q = "Vamsi" # XXX: Enter in your API key from https://code.google.com/apis/console API_KEY = '' service =…
Pavan Vamsi
  • 125
  • 1
  • 1
  • 6
0
votes
2 answers

Python script not sending request params

I'm trying to send a POST request to my server. The server is reached. I can see that by the servers response but the parameters are not sent. The request needs the params in a JSON object. params = "{'spam': 1, 'eggs': 2, 'bacon': 0}" c =…
Jacob
  • 3,580
  • 22
  • 82
  • 146
0
votes
1 answer

Equivalent Python code for the following Java http get requests

I am trying to convert the following Java code to Python. Not sure what I am doing wrong, but I end up with an internal server error 500 with python. Is the "body" in httplib.httpConnection method equivalent to Java httpentity? Any other thoughts on…
0
votes
0 answers

Connection refused error while using python-Instagram API

I tried to run a simple code to extract data from Instagram using Python-Instagram module The code is from instagram.client import InstagramAPI api = InstagramAPI(client_id='YOUR_CLIENT_ID',client_secret='YOUR_CLIENT_SECRET') popular_media =…
Prince Bhatti
  • 4,671
  • 4
  • 18
  • 24
0
votes
0 answers

multiple HTTPConnection requests to different domains throws out socket.error in Python

My python script needs to establish two HTTPConnection from the httplib library, each connecting to a different domain to GET data. I also have to make multiple requests to those domains multiple times. The data returned from requests is all in…
alextc
  • 3,206
  • 10
  • 63
  • 107
0
votes
1 answer

Issue with httlib and HTTPSConnection Using a Proxy (Proxy)

To reproduce my issue, you need to have fiddler open and watching internet traffic. Fiddler's proxyurl is 127.0.0.1 and port is 8888. But in reality, I get this issue with any proxy over HTTPS. Using the HTTPSConnection class, I set the proxy and…
code base 5000
  • 3,812
  • 13
  • 44
  • 73
0
votes
3 answers

sending http requests with specific/non-existent http version protocol in Python

There is some way to send http requests in python with specific http version protocol.I think that, with httplib or urllib, it is not possible. For example: GET / HTTP/6.9 Thanks in advance.
jomag
  • 19
  • 4
0
votes
2 answers

How to do Google API batch request using python httplib or urllib2?

After the user authorizes the 'read' permission, I need to fetch all the emails of the user. I have access_token/refresh_token which help me to make individual calls for each email. I want to do batch request for all message_ids to reduce the time…
kawadhiya21
  • 2,458
  • 21
  • 34