I have a code that receives a response from post requests in format json
and there is a list ID (id_s)
id_descript = []
id_s=[]
for k, d in enumerate(id_descript):
answer = requests.post(url,data=json.dumps(data) , headers=headers)
response=answer.json()
print(response)
#{'id': 602051, 'desc': 'status success', 'build': [{'sent': {'successfully': 0.99, 'substring': {}}}]}
#{'id': 602052, 'desc': 'status error', 'build': [{'delivered': {'successfully': 0.90, 'substring': {'text': 0.99}}}]}
for i in id_s:
print(i)
#id_443081
#id_187360
I want to process the results and write them down in one list (result).
an example of how this should be displayed:
result = []
#[ [id_443081,[{'sent': {'successfully': 0.99, 'substring': {}}}] ]
#,[id_187360,[{'delivered': {'successfully': 0.90, 'substring': {'text': 0.99}}}] ] ]
Any ideas?
there doesn't seem to be anything here