I am trying to send a json file to a url (post). I am using data parameter to open the file and send it to the url:
r = requests.post(url_info, data=open(f, 'rb'), headers=headers, verify=False)
This works right now but I have been asked to use "json" insteand of "data" to send the file.
I have seen some examples using json created as dictionaries where this is working but I am not able to make it work from a file.
I have tried to use it directly:
json=open(f, 'rb')
In f I have the route to the json file. Serialize the json file with json.dumps(open.... But I always get a message telling me that