Skip to content

Commit

Permalink
Closes #158. Part of #346.
Browse files Browse the repository at this point in the history
  • Loading branch information
Esmail Fadae authored and jnm committed Apr 11, 2017
1 parent 3755015 commit fa377be
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions onadata/apps/restservice/services/generic_json.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import httplib2
import json

import requests

from onadata.apps.restservice.RestServiceInterface import RestServiceInterface


Expand All @@ -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)

0 comments on commit fa377be

Please sign in to comment.