Skip to content

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

@nishat-sayyed

Description

@nishat-sayyed

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions