I have a Django model that looks like the following:
[
{
"ticker": "AAPL",
"balance_sheet": [],
"income_statement": [],
"cash_flows": []
},
{
"ticker": "MSFT",
"balance_sheet": [],
"income_statement": [],
"cash_flows": []
}
]
I want to add in the income_statement data using the requests.post
function but cannot figure out how the data should be structured. I get a 400 BAD REQUEST response from the server.
What is the problem ?
r = requests.post('http://localhost:8000/stocks/', data={ 'ticker': 'MSFT',
'income_statement': [{
'annualNetIncomeContinuousOperations': 45687000000,
'annualTaxEffectOfUnusualItems': 0,
'annualNetIncomeFromContinuingOperationNetMinorityInterest': 45687000000,
'annualTotalOperatingIncomeAsReported': 60024000000,
... ,
... ,
...
}]
}
)