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

TypeError: Cannot read property 'trim' of undefined - (Python requests library) #26

Open
nishat-sayyed opened this issue Apr 6, 2020 · 0 comments

Comments

@nishat-sayyed
Copy link

nishat-sayyed commented Apr 6, 2020

I get the following error when I submit a POST request using Python's requests library

Stack: TypeError: Cannot read property 'trim' of undefined
     at process (/home/nishat/project/node_modules/parse-multipart/multipart.js:38:44)
     at Object.exports.Parse (/home/nishat/project/node_modules/parse-multipart/multipart.js:87:19)

My Python code (Client side):

path = 'input.png'
files = [('photo', open(path, 'rb')),]
r = requests.post(url, files=files)

The request generated in Python at client side looks like this:

--0f178608772b425484b9b4abc0f6e281
Content-Disposition: form-data; name="photo"; filename="input.png"


--0f178608772b425484b9b4abc0f6e281--
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