httplib

How do I get the IP address from a http request using the requests library?

How do I get the IP address from a http request using the requests library? Question: I am making HTTP requests using the requests library in python, but I need the IP address from the server that responded to the HTTP request and I’m trying to avoid making two calls (and possibly having a different …

Total answers: 2

Python-Requests close http connection

Python-Requests close http connection Question: I was wondering, how do you close a connection with Requests (python-requests.org)? With httplib it’s HTTPConnection.close(), but how do I do the same with Requests? Code: r = requests.post("https://stream.twitter.com/1/statuses/filter.json", data={‘track’:toTrack}, auth=(‘username’, ‘passwd’)) for line in r.iter_lines(): if line: self.mongo[‘db’].tweets.insert(json.loads(line)) Asked By: user179169 || Source Answers: As discussed here, there really …

Total answers: 8

Proxying to another web service with Flask

Proxying to another web service with Flask Question: I want to proxy requests made to my Flask app to another web service running locally on the machine. I’d rather use Flask for this than our higher-level nginx instance so that we can reuse our existing authentication system built into our app. The more we can …

Total answers: 3

Python urllib vs httplib?

Python urllib vs httplib? Question: When would someone use httplib and when urllib? What are the differences? I think I ready urllib uses httplib, I am planning to make an app that will need to make http request and so far I only used httplib.HTTPConnection in python for requests, and reading about urllib I see …

Total answers: 6

Python httplib ResponseNotReady

Python httplib ResponseNotReady Question: I’m writing a REST client for elgg using python, and even when the request succeeds, I get this in response: Traceback (most recent call last): File “testclient.py”, line 94, in <module> result = sendMessage(token, h1) File “testclient.py”, line 46, in sendMessage res = h1.getresponse().read() File “C:Python25libhttplib.py”, line 918, in getresponse raise …

Total answers: 6

HTTPS connection Python

HTTPS connection Python Question: I am trying to verify the that target exposes a https web service. I have code to connect via HTTP but I am not sure how to connect via HTTPS. I have read you use SSL but I have also read that it did not support certificate errors. The code I …

Total answers: 8