the JSON object must be str, bytes or bytearray, not Response code example
Example 1: python write request must be str not bytes
datafile = open(localfile, "w", encoding="utf-8")
datafile.write(page.text)
datafile.close()
Example 2: python write request must be str not bytes
datafile = open(localfile, "wb")
datafile.write(page.content)
datafile.close()