0
good afternoon! I have a python script that I need to pass a Json via URL to an application, which validates through the mac address. With several researches, I have been testing the code below, even to have an understanding of what is happening. The reason you’re starting in Python. When running the script does not give any error, or accuses at least the attempt to pass something invalid in the log.
import json
url = 'http://aplicacao.com.br/recebe'
files = {'file': ('file.json', open('file.json', 'rb'))}
headers = {'content-type': 'application/json'}
my file.json is this way:
[{"nome": "nome", "end": "end", "email": " email", "tel": "tel"},
{"nome": "nome", "end": "end", "email": " email", "tel": "tel"}]
Thank you
Add the snippet where your script sends the
json
to the url– reisdev