From 30d1dda8ed99705099dc941c01c00338f788b7e1 Mon Sep 17 00:00:00 2001 From: Keegan McAllister Date: Wed, 17 Oct 2012 17:24:13 -0400 Subject: [PATCH] api: Drop HTTP Digest authentication (imported from commit 6867528cbd51a9e4a7cdacb181befcd034b90d59) --- common.py | 6 +----- examples/curl-examples | 7 +++---- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/common.py b/common.py index 9d3d220..2b11521 100644 --- a/common.py +++ b/common.py @@ -19,11 +19,7 @@ class HumbugAPI(): request["api-key"] = self.api_key while True: try: - res = requests.post(self.base_url + url, - data=request, - verify=True, - auth=requests.auth.HTTPDigestAuth('tabbott', - 'xxxxxxxxxxxxxxxxx')) + res = requests.post(self.base_url + url, data=request, verify=True) if res.status_code == requests.codes.service_unavailable: # On 503 errors, try again after a short sleep time.sleep(0.5) diff --git a/examples/curl-examples b/examples/curl-examples index aaa33ae..d3ebc0f 100755 --- a/examples/curl-examples +++ b/examples/curl-examples @@ -1,7 +1,6 @@ #!/bin/sh # Two quick API tests using curl -curl --digest -u tabbott:xxxxxxxxxxxxxxxxx https://app.humbughq.com/api/v1/send_message -d "api-key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" -d "email=tabbott@humbughq.com" -d "type=personal" -d "content=test" -d "recipient=tabbott@humbughq.com" -curl --digest -u "tabbott:xxxxxxxxxxxxxxxxx" https://app.humbughq.com/api/v1/get_messages -d "api-key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" -d "email=tabbott@humbughq.com" +curl https://app.humbughq.com/api/v1/send_message -d "api-key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" -d "email=tabbott@humbughq.com" -d "type=personal" -d "content=test" -d "recipient=tabbott@humbughq.com" +curl https://app.humbughq.com/api/v1/get_messages -d "api-key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" -d "email=tabbott@humbughq.com" -# Replace '--digest -u tabbott:xxxxxxxxxxxxxxxxx https://app.humbughq.com' -# with "http://127.0.0.1:8000" for local testing +# Or replace https://app.humbughq.com with your local test instance