Storing a json post request in variables in python
<p>I am sending a json post request in Python and I am getting two return dictionary values but they are stored in one object.</p>

<p>This is what I have:</p>

<pre><code>import json
import requests

def call():
    pay = {'token' : "4593543"}
    r = requests.post('https://www.hackerrank.com/challenges', params=pay)
</code></pre>

<p>I am getting two values store in the <code>r</code> object.</p>

<pre><code>'{"needle":"qvsmbjkc", "haystack": ["pgunkqay","qvsmbjkc","qgswmzin","arwokfjm","taskzcup","yjvcabgr","xcrsldof","tecipvzf","cjtahlqb","pqgykrcz","ufyjrpad","hqezmcwl","fsyimbxr","tosqznha","lzujpvob","mbfsikde","nqvpjbhi","uwsqybai","ozetipqw","imancdqr"]}'
</code></pre>

<p>A <em>needle</em> and <em>haystack</em> value but they are both in the <code>r</code> object. How can I separate them into different variables?</p>