skip to Main Content

Add timestamp to API call JSON output

I need to add timestamp in key-value format on a JSON response. This is what I have right now: now = datetime.datetime.now().isoformat(sep=" ", timespec="seconds") result = session.get(urljoin(baseurl, path), headers=headers, params=querystring, verify=False) jsonarray = result.json() json_object = json.dumps(jsonarray) #writing to outputfile…

VIEW QUESTION
Back To Top
Search