Skip to content

Content Type Header for Python Requests for Multipart POST Request causes Errors #268

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

Closed
davidtsong opened this issue May 30, 2020 · 2 comments
Assignees
Labels

Comments

@davidtsong
Copy link

Describe the bug
Postman generates a 'Content-Type': 'multipart/form-data; boundary=----WebKitFormBoundaryCH5n7WHVqUCBNgd6', as a header leading to an inaccurately set boundary when actually running the code using Python.(-> 500 error from server).

To Reproduce
Create a multipart POST request with file upload on Postman and generate a code snippet. Run this code snippet in Python.(might also occur with other programming languages too). Even though the request works in Postman, it does not work in Python(500 error).

Expected code snippet and corresponding request
Basically, I removed the content type header and things worked fine.

Additional context
https://stackoverflow.com/questions/17415084/multipart-data-post-using-python-requests-no-multipart-boundary-was-found

@davidtsong davidtsong changed the title Remove Content Type Header for Python Requests for Multipart POST Request Content Type Header for Python Requests for Multipart POST Request causes Errors May 30, 2020
@someshkoli
Copy link
Contributor

Can you tell me more about the app version and ss along with it ? Also are you using the new code generator ? Go-to settings and switch to new code generator if you haven't already
image
Second option

@dhwaneetbhatt
Copy link
Contributor

Hey @davidtsong, just stumbled across this old issue and it seems to be working fine now. The header is not being set now. Please reopen the issue with details if you are still facing problems.

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

No branches or pull requests

5 participants