Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated hoover to use python requests instead of httplib2 #7

Merged
merged 4 commits into from Feb 23, 2013
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

modifying hoover to use requests instead of httplib2

  • Loading branch information
gingerlime committed Feb 22, 2013
commit ee1d3e98dc1c6c4f0b00d012699e80df6e7653f5
@@ -1,5 +1,5 @@
from functools import wraps
from httplib2 import Http
import requests


def async(func):
@@ -23,14 +23,13 @@ def newfunc(*args, **kwargs):


def post_to_endpoint(endpoint, message, encoding='utf-8'):
h = Http()
# If unicode, try to encode
if isinstance(message, unicode):
try:
message = message.encode(encoding)
except UnicodeEncodeError:
pass
h.request(endpoint, 'POST', message)
requests.post(endpoint, message)
async_post_to_endpoint = async(post_to_endpoint)


ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.