title: How to convert a dictionary list to JSON
body: <p>I'm trying to peform an A/B test of two ML models and I require to parse data to the model via json.  Below is the code</p>
  <pre><code>for i in range(100):
      input_data = dict(X_test.iloc[i])
      target = y_test.iloc[i]
      r = requests.post(&quot;http://127.0.0.1:8000/api/v1/ddos_classifier/predict?status=ab_testing&quot;, input_data)
      response = r.json()
      # provide feedback
      requests.put(&quot;http://127.0.0.1:8000/api/v1/mlrequests/{}&quot;.format(response[&quot;request_id&quot;]), {&quot;feedback&quot;: target})
  </code></pre>
  <p>input_data is in the form of a dictionary
  The code returns this error:</p>
  <pre><code>JSONDecodeError: Expecting value: line 1 column 1 (char 0)
  </code></pre>
  <p>Full traceback</p>
  <pre><code>JSONDecodeError                           Traceback (most recent call last)
  &lt;ipython-input-6-254afd81a7cc&gt; in &lt;module&gt;
        3     target = y_test.iloc[i]
        4     r = requests.post(&quot;http://127.0.0.1:8000/api/v1/ddos_classifier/predict?status=ab_testing&quot;, input_data)
  ----&gt; 5     response = r.json()
        6     # provide feedback
        7     requests.put(&quot;http://127.0.0.1:8000/api/v1/mlrequests/{}&quot;.format(response[&quot;request_id&quot;]), {&quot;feedback&quot;: target})
  
  c:\users\mark silla\appdata\local\programs\python\python37\lib\site-packages\requests\models.py in json(self, **kwargs)
      896                     # used.
      897                     pass
  --&gt; 898         return complexjson.loads(self.text, **kwargs)
      899 
      900     @property
  
  c:\users\mark silla\appdata\local\programs\python\python37\lib\json\__init__.py in loads(s, encoding, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw)
      346             parse_int is None and parse_float is None and
      347             parse_constant is None and object_pairs_hook is None and not kw):
  --&gt; 348         return _default_decoder.decode(s)
      349     if cls is None:
      350         cls = JSONDecoder
  
  c:\users\mark silla\appdata\local\programs\python\python37\lib\json\decoder.py in decode(self, s, _w)
      335 
      336         &quot;&quot;&quot;
  --&gt; 337         obj, end = self.raw_decode(s, idx=_w(s, 0).end())
      338         end = _w(s, end).end()
      339         if end != len(s):
  
  c:\users\mark silla\appdata\local\programs\python\python37\lib\json\decoder.py in raw_decode(self, s, idx)
      353             obj, end = self.scan_once(s, idx)
      354         except StopIteration as err:
  --&gt; 355             raise JSONDecodeError(&quot;Expecting value&quot;, s, err.value) from None
      356         return obj, end
  
  JSONDecodeError: Expecting value: line 1 column 1 (char 0)
  </code></pre>
  <p>What could be the issue</p>