From 5dc3bbcddd129abd8b28ca3f3b19603dc73c9a8b Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Sat, 22 Feb 2014 21:58:21 -0500 Subject: [PATCH] Theoretically add JSON support for data input to HTTP API I have not yet tested this support to assure it works. --- confluent/httpapi.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/confluent/httpapi.py b/confluent/httpapi.py index 18b767ae..a84f2f44 100644 --- a/confluent/httpapi.py +++ b/confluent/httpapi.py @@ -107,6 +107,10 @@ def _get_query_dict(env, reqbody, reqtype): qdict[ky] = na else: qdict[ky] = pbody[ky][0] + elif 'application/json' == reqtype: + pbody = json.loads(reqbody) + for key in pbody.iterkeys(): + qdict[key] = pbody[ky] if 'restexplorerhonorkey' in qdict: nqdict = {} for key in qdict: