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

python: printing information about BadStatusLine error

I'm getting a BadStatusLine after executing the following python script. How can I print details about the BadStatusLine? #!/usr/bin/python import urllib import urllib2 import httplib try: # NoActiveDevsPerQtr request =…
stack user
  • 835
  • 1
  • 9
  • 28
0
votes
1 answer

HTTP Requests using a range of IP address on python

I have a VM as a server with IP address 10.91.55.2. I have another VM which acts as a client having IP address in the range 10.91.56.2......10.91.56.10. I want to write a script that will use all these IP address on the client to send HTTP request…
0
votes
1 answer

HTTP requests using multiple IP addresses on python

I'm writing a python script that will send http requests concurrently to the urls mentioned in a file using python. The script works fine for a single IP address. The OS I'm using is linux. I've generated virtual IP addresses like eth0:1,eth0:2 etc.…
0
votes
1 answer

Need to measure HTTP request latency and send result to graphite depending on the contents of the Akamai headers

I'm not a programmer. I have been looking at a way to write a python script to measure the latency of a web request to an Akamai URL and send this data to graphite via statsd depending on whether the Akamai cache reports a HIT or MISS so that I can…
LinuxNinja
  • 101
  • 3
0
votes
1 answer

SSL error while connecting with python httplib and pem file

I am trying to connect to an HTTPS WS with a python client using PEM file and httplib here is the code # HTTPS connection with python #!/usr/bin/env python import httplib , urllib CERTFILE = 'path_to_pem_file' hostname =…
Mohamed Ali JAMAOUI
  • 14,275
  • 14
  • 73
  • 117
0
votes
1 answer

Invalid data format returned from httplib.HTTPSConnection request

#!/usr/local/bin/python2.7 import httplib, urllib params = urllib.urlencode({"username":"api", "password":"cisco123", "data":{"token":""}}) headers = {"Content-Type":"application/json", "Accept":"application/json"} conn =…
0
votes
1 answer

Error in Json request :{"jsonrpc":"2.0","id":44,"error":{"code":-32603,"message":"No such service method"}}

I'm trying to create a HTTPSConnection to this address: "android-review.googlesource.com" and send a json request. This address: "android-review.googlesource.com" is for Gerrit code review system which uses REST API. You can find more information…
star2014
  • 173
  • 2
  • 5
  • 14
0
votes
0 answers

Python httplib.HTTPSConnection import error

I am using MySQL Connector/Python to insert something in a database and it works perfectly fine when I run it from the linux console (Ubuntu), but when I try and execute the script from a web page, I get the following error:
Stefan Manciu
  • 490
  • 1
  • 6
  • 19
0
votes
2 answers

Python determine if HTTPConnection failed to connect

In Python, how I can determine if HTTPConnection failed to connect to server, for example, by bad server address? import httplib import sys if len(sys.argv) != 2: print 'Usage: server' quit() con = httplib.HTTPConnection(argv[1]) # how I can…
0
votes
0 answers

Where i put my library httplib2 in my GAE project

I tried to make a simple application "guestbook" that stores the messages in the drive of the author. I use the libraries "httplib2", "apiclient" "," UriTemplate ". Google app engine does not support these libraries so I have included in my project.…
0
votes
2 answers

Python: puzzling behaviour inside httplib

I have added one line ( import pdb; pdb.set_trace() ) to httplib's HTTPConnection.putheader, so I can see what's going on inside. Python26\Lib\httplib.py, line 489: def putheader(self, header, value): """Send a request header line to the…
Anna
  • 11
  • 1
0
votes
2 answers

How to update httplib module?

After running into this one - previous post which recommended updating httplib i want to upgrade my httplib module. I have no idea how. I'm using easy_install, but when trying to call easy_install httplib it didn't find matches. Please help.
omer bach
  • 2,345
  • 5
  • 30
  • 46
0
votes
0 answers

how to send a post request with binary files

There is form can upload files and input some fields, I built it using RoR But what if I want to mimic sending a form in command line. I want to achieve with Pyhton or Ruby How to do it ? I think I need to overcome the crsf_token first (I can wget…
user3675188
  • 7,271
  • 11
  • 40
  • 76
0
votes
1 answer

online web form access using python

I am trying to access websites that require login information. For practice I tried getting into Hotmail just to see if it would work. I have no idea if this code is right. With trial and error I have the code "running", but it isn't working still..…
0
votes
1 answer

Use default proxysettings with httplib

Is there a way to use the system's default proxy to setup a httptunnel with httplib(2)(without having to provide the info and credentials)? I've had a look at urllib2.ProxyHandler and that seems to do everything I want. But if I google for an…
David
  • 965
  • 3
  • 12
  • 24