Skip to content

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

@davidtsong

Description

@davidtsong

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions