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 http page without heads

i have to search for a specific url, through a large number of ips. I've written a script in python that checks if port its open, and then checks if the url exist using httplib, and it's working great! My problem is that i've been getting too many…
TadeoArmenta
  • 154
  • 6
  • 16
0
votes
2 answers

How to return multiple values in python

I am working currently working on a spider; but I need to be able to call the Spider() function more than once to follow links, here is my code: import httplib, sys, re def spider(target, link): try: conn =…
D4zk1tty
  • 123
  • 1
  • 3
  • 15
0
votes
2 answers

Filtering a variable so it only contains a specified string python

I am trying to make link crawler in python; I know about harvestman but that's not what I am looking for. Here is what I have so far: import httplib, sys target=sys.argv[1] subsite=sys.argv[2] link = "http://"+target+subsite def spider(): …
D4zk1tty
  • 123
  • 1
  • 3
  • 15
0
votes
1 answer

httplib to connect to IMAP email server?

I'm curious, can the httplib be jury rigged to connect to an IMAP email server? I'm being forced to python connect to an IMAP server without using IMAPlib and while I've learned a lot about sockets and IMAP, I'm frankly growing tired of the exercise…
Pinwheeler
  • 1,061
  • 2
  • 13
  • 26
0
votes
1 answer

wxpython httplib with proxy shows 400 bad request

Took a look at the other threads but couldn't build anything from it. I have a list of URL's which I'm trying to get the HEAD status of and check before further manipulation. My current code with httplib works fine (else part), however I need to…
jerrythebum
  • 330
  • 1
  • 6
  • 17
0
votes
1 answer

httplib python/wxpython. sock stream error

I'm trying to check a few URLs to see if they come back as OK before I further manipulate them, I have a list of URLs in self.myList, which then runs these through the httplib HTTP Connection to get the response, however I get a load of errors from…
jerrythebum
  • 330
  • 1
  • 6
  • 17
0
votes
0 answers

Translate curl to Python httplib

Hadoop offers a REST API using curl. For some reason, I need to use httplib but not pycurl. Can you translate this request to httplib? The test.txt local file should be transmitted by HTTPConnection.send(data), as I need transmit the file by…
Levi
  • 55
  • 3
  • 8
0
votes
1 answer

Put this request with Python httplib

I want to put a request to HDFS REST API. It works in the RESTClient. But it failed when i translate it to Python edition( python httplib). And i can't use this in Curl for some reason. Anybody know httplib put, can help me translate it to Python…
Levi
  • 55
  • 3
  • 8
0
votes
0 answers

Google Fusion Tables POST requests return 400 Bad Request using Python

I am trying to create a script Python script that allows me to both Read a Google Fusion Table and to import rows in to it. I have been working with the sample code found at https://developers.google.com/fusiontables/docs/samples/python to try and…
Tiberius
  • 15
  • 1
  • 5
0
votes
1 answer

Python: httplib request() not working

I'm having issues using httplib's request() method. It's a really odd problem. My code looks like this: query = "/search.json?q=&geocode=" + slat + "," + slong + "," + mline[2] + "km&rpp=" + mline[3] conn =…
pauliwago
  • 6,373
  • 11
  • 42
  • 52
0
votes
2 answers

With the Python httplib "HTTPConnection" object, how do you send a header without a value?

I have the following code but httplib still treats the header 'emptyheader' as key:value pair. h = httplib.HTTPConnection("somewhere:5000") headers = {} headers['emptyheader'] = None h.request('POST', '/somewhere', '', headers) How do I send the…
Will
  • 3
  • 3
0
votes
1 answer

Can't get Custom DNS server working in Python

I'm having real trouble getting python to use a custom dns server. I have followed this Tell urllib2 to use custom DNS If I don't specify a self.host and self.port, it will go through without blocking. Here is the code: import urllib2 import…
user2016396
  • 3
  • 1
  • 3
0
votes
2 answers

I can't catch BadeStatusLine in an eventlet greenthread

I have a long running process that crashes about every three days because during an HTTP connection, after the connection is made but before any data is received, httplib throws BadStatusLine. I've tried wrapping my call, but the exception just…
user1552512
  • 869
  • 1
  • 9
  • 14
0
votes
1 answer

getaddrinfo 11004 and python's httplib

I'm trying to get the rendered markup for http://www.epicurious.com/recipes/food/reviews/Breaded-Chicken-Cutlets-aka-Grandma-Jodys-Chicken-51114400; in theory the very same markup given by the 'View Page Source' menu option in Firefox. I'm using a…
0
votes
1 answer

httplib call to internal server

I have written a simple program to render requested country's svg image of Flag. To make sure that the image exists I want to check first. However, I get following exception: HTTPException: Deadline exceeded while waiting for HTTP response from URL:…
Oo.oO
  • 33
  • 3
1 2 3
21
22