I have situation where i get http response with missing value for a key.
import requests
http = requests.get(url, verify=False, auth=HTTPBasicAuth(self.username, self.password),
timeout=self.timeout, headers=headers)
http.text gives output but http.json doesn't give any output.I understand that this issue is because of Invalid json format.
'{"PLMNID":[
{
"mNc":,
"id":3,
"mcc":
},
{
"mNc":,
"id":4,
"mcc":
},
{
"mNc":,
"id":5,
"mcc":
},
{
"mNc":,
"id":6,
"mcc":
}}'
Currently I retrun http.json.I see no response and also no error. Now i planning to return http.text output and some how add default value (may be '' or null)for missing key and proceed.
Do we have any python json api which will add default value for missing value for a key.