-
Notifications
You must be signed in to change notification settings - Fork 837
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
Sending unwanted Content-Type text/plain with binary uploads #2521
Comments
Actually, I just confirmed my suspicion. If I switch to a "raw" body and select "JSON (application/json)", then switch back to "binary", the server receives "application/json" now |
We'll fix this issue around setting the Content-Type header automatically in a future version. For now, we recommend setting the Content-Type explicitly. |
Agreed, I just spent a bunch of time troubleshooting an issue where I was trying to test an app with a POST with no Content-Type specified but it appeared as if a Content-Type header was being set to 'text/plain' even though my Postman config had no such header defined. I thought there was a bug in the app code since nothing in Postman indicated it was sending this header. Eventually by debugging the app I found that the header was being sent by Postman. Based on the above if I explicitly set the Content-Type header with no value specified, but even this included a Content-Type header in the payload, just with no value. There doesn't appear to be a way at present to force it to not automatically add the header. This page seems to imply it's a feature!
But I say this is unexpected and undesirable behavior as it basically makes Postman incapable of posting a payload without that header, and at least in my case this is exactly what I was trying to test. I think perhaps this feature was misguided, but maybe others like it. It would be nice to be able to disable this functionality. |
Copy that. I need to be able to test the scenario where no Content-Type header is given. |
I'd like to second this. This is an error condition I need to test. |
While testing Apaches Tika server, I ran into this problem, namely that a Content-Type: text/plain is sent along. |
I am having the same issue using postman v 6.7.4, is it resolved? What's the status? |
@a85 what if you need no |
It seems strange to close the issue before the issue is actually resolved, and likely to make the problem go forgotten indefinitely. I ran into problems with this myself. |
text/plain
is sent instead of nothingI suspect this might be a problem of the default Content-Type from the "raw" body carrying over when switching to a "binary" body. The problem is solved by setting an explicit Content-Type header
The text was updated successfully, but these errors were encountered: