-
Notifications
You must be signed in to change notification settings - Fork 174
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
POST with file param not setting multipart/form-data? #166
Comments
Can you provide more context, how about a code sample that demonstrates the issue? |
For e.g. POST, This seems to override the proper "multipart/form-data" content type which Overriding it manually using I workarounded this locally by making this modification: entity_method = method.upper() in ENTITY_METHODS
- if entity_method:
+ if entity_method and not req_kwargs.get('files', None):
req_kwargs['headers'].setdefault('Content-Type', FORM_URLENCODED) |
@anssih mind submitting a patch for that? |
+1 This stumped me for a couple of hours when trying to upload to twitter's media/upload endpoint. Same fix worked. |
@davidkhess patches welcome. :) |
… form-data due to attached files.
Ok, you guilted me into it. :-) |
Fix for #166 - Content-Type is being overridden
I'm trying to make a multipart/form-data POST and can't figure out how to set the content-type to multipart/form-data. It's 'content-type': 'application/x-www-form-urlencoded'. - That's strange to me because I see the boundary in the body..
When I manually set the content-type header to multipart/form-data, then there's no boundary defined...
The text was updated successfully, but these errors were encountered: