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

Headers kwarg overrides Poster headers #13

Closed
jlmurphy opened this issue Mar 6, 2011 · 1 comment
Closed

Headers kwarg overrides Poster headers #13

jlmurphy opened this issue Mar 6, 2011 · 1 comment

Comments

@jlmurphy
Copy link

jlmurphy commented Mar 6, 2011

If a caller uses both the files and headers kwargs in requests.request, the dictionary provided in headers will override the multipart encoding headers generated by Poster. See line 180 in core.py. Also, I am using v0.3.0

The request will fail with the following error:

ValueError: No Content-Length specified for iterable body

Example:

import requests

files={ "hello.txt.", "/path/to/file/hello.txt." }

# this works
requests.post('http://path/to/server', files=files)

# this does not work
requests.post('http://path/to/server', headers={ 'Accept' : 'application/json' }, files=files }
@kennethreitz
Copy link
Contributor

Better POSTER header compatibility (Closed by 9fdee25)

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 9, 2021
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants