I have the following curl
command
curl -X POST "http://localhost:5000/api/v1/image/cad1b12e-c374-4d46-b43b-3ddbe7d683c4" -H "accept: application/json" -H "Content-Type: multipart/form-data" -F "file=@tests/test.jpg;type=image/jpeg"
I am trying to construct a pytest
function with the same behavior that the command above but I am not getting the exact result, the pytest
function is the following
url = "http://localhost:5000/api/v1/image/cad1b12e-c374-4d46-b43b-3ddbe7d683c4"
payload={}
files=[('file',('test.png',open('./tests/test.png','rb'),'image/png'))]
headers = {
'accept': 'application/json',
'Content-Type': 'multipart/form-data'
}
response = requests.request("POST", url, headers=headers, data=payload, files=files)