From fa377becefaa2b298624ede37a9939cfe78bda16 Mon Sep 17 00:00:00 2001 From: Esmail Fadae Date: Mon, 10 Apr 2017 18:46:22 -0400 Subject: [PATCH] Closes #158. Part of #346. --- onadata/apps/restservice/services/generic_json.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/onadata/apps/restservice/services/generic_json.py b/onadata/apps/restservice/services/generic_json.py index 26199de8b..f31ce553c 100644 --- a/onadata/apps/restservice/services/generic_json.py +++ b/onadata/apps/restservice/services/generic_json.py @@ -1,6 +1,7 @@ -import httplib2 import json +import requests + from onadata.apps.restservice.RestServiceInterface import RestServiceInterface @@ -11,7 +12,4 @@ class ServiceDefinition(RestServiceInterface): def send(self, url, parsed_instance): post_data = json.dumps(parsed_instance.to_dict_for_mongo()) headers = {"Content-Type": "application/json"} - http = httplib2.Http() - resp, content = http.request(uri=url, method='POST', - headers=headers, - body=post_data) + requests.post(url, headers=headers, data=post_data)