Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python Generator generates not string form-data #678

Open
pokecheater opened this issue Feb 27, 2023 · 0 comments
Open

Python Generator generates not string form-data #678

pokecheater opened this issue Feb 27, 2023 · 0 comments

Comments

@pokecheater
Copy link

pokecheater commented Feb 27, 2023

Describe the bug
Hi there Postman-Team,

I noticed that the code generator for python has issues with a edge case of form-data. I send a zip file along with a string as form-data. Here is a screenshot (I will export the request for u as well :))

image

To Reproduce
Import the collection and try out the code generation.
Okay I tried to add the json file, but it is not allowed. (You should support that since this is your export format). Here as zip:
export.postman_collection.json.zip

Expected code snippet and corresponding request
I adapted the generated code and the following did work for me:
`
import requests

url = "http://127.0.0.1:5002/executors"

payload={}
files=[
('executor',('iris_classifier.zip',open('/Users/r2d2/dev/IAPP-TESTING/iris_classifier.zip','rb'),'application/zip')),
('executor_name', (None,'name',None))
]
headers = {
'auth_key': '123'
}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
`

POSTMAN VERSION
I used Version 9.31.0 (9.31.0) on macosx.

Thx in advance. I hope this helps you to improve your already great product even further <3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant