Skip to content

Commit

Permalink
Stashing work in progress for removing httplib2 use. #346
Browse files Browse the repository at this point in the history
  • Loading branch information
Esmail Fadae committed Apr 19, 2017
1 parent fa377be commit 1217397
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 9 deletions.
4 changes: 1 addition & 3 deletions onadata/apps/restservice/services/f2dhis2.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import httplib2
import requests

from onadata.apps.restservice.RestServiceInterface import RestServiceInterface
Expand All @@ -12,8 +11,7 @@ def send(self, url, parsed_instance):
instance = parsed_instance.instance
info = {"id_string": instance.xform.id_string, "uuid": instance.uuid}
valid_url = url % info
http = httplib2.Http()
resp, content = http.request(valid_url, 'GET')
requests.get(valid_url)

def send_ziggy(self, url, ziggy_instance, uuid):
info = {"id_string": ziggy_instance.xform.id_string, "uuid": uuid}
Expand Down
6 changes: 2 additions & 4 deletions onadata/apps/restservice/services/generic_xml.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import httplib2
import requests

from onadata.apps.restservice.RestServiceInterface import RestServiceInterface

Expand All @@ -10,6 +10,4 @@ class ServiceDefinition(RestServiceInterface):
def send(self, url, parsed_instance):
instance = parsed_instance.instance
headers = {"Content-Type": "application/xml"}
http = httplib2.Http()
resp, content = http.request(
url, method="POST", body=instance.xml, headers=headers)
requests.post(url, instance.xml, headers=headers)
1 change: 0 additions & 1 deletion requirements/base.pip
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ django-guardian==1.4.1
django-registration-redux==1.3
django-templated-email==0.4.9
gdata==2.0.18
httplib2==0.9
mock==1.0.1
httmock==1.2.2
modilabs-python-utils==0.1.5
Expand Down
1 change: 0 additions & 1 deletion requirements/latest.pip
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ django-guardian>=1.1.1
django-registration>=1.0
django-templated-email==0.4.1
gdata>=2.0.16
httplib2
mock>=1.0.1
httmock>=1.0.6
modilabs-python-utils>=0.1.5
Expand Down

0 comments on commit 1217397

Please sign in to comment.