I am sending a json post request in Python and I am getting two return dictionary values but they are stored in one object.
This is what I have:
import json
import requests
def call():
pay = {'token' : "4593543"}
r = requests.post('https://www.hackerrank.com/challenges', params=pay)
I am getting two values store in the r object.
'{"needle":"qvsmbjkc", "haystack": ["pgunkqay","qvsmbjkc","qgswmzin","arwokfjm","taskzcup","yjvcabgr","xcrsldof","tecipvzf","cjtahlqb","pqgykrcz","ufyjrpad","hqezmcwl","fsyimbxr","tosqznha","lzujpvob","mbfsikde","nqvpjbhi","uwsqybai","ozetipqw","imancdqr"]}'
A needle and haystack value but they are both in the r object. How can I separate them into different variables?
{}button to format the code as code. Use the preview below the textbox to see what it it will look like.r.json()method to extract the JSON object .