postman-app-support icon indicating copy to clipboard operation
postman-app-support copied to clipboard

Postman not sending the automatically generated Content-Type header

Open lscown opened this issue 1 year ago • 5 comments

Is there an existing issue for this?

  • [X] I have searched the tracker for existing similar issues and I know that duplicates will be closed

Describe the Issue

When attempting to send a multipart/form-data file, the auto-generated Content-Type header is not sent through to the server, however if I set one manually, it is.

Oddly, this worked just once, and then every request afterwards does not contain the auto-generated Content-Type.

Steps To Reproduce

  1. Set up a multipart request, do not populate Content-Type key/value.
  2. Upload a file in form-data, making sure a new Content-Type header is populated
  3. Send request

A side effect of this, I can't seem to upload anymore files either. I saved the file to the team, if that causes issues.

Screenshots or Videos

Screenshot 2024-02-19 at 4 20 29 PM Screenshot 2024-02-19 at 4 20 10 PM

Operating System

macOS

Postman Version

10.23.1-240213-0704

Postman Platform

Postman Web

User Account Type

Signed In User

Additional Context?

No response

lscown avatar Feb 19 '24 03:02 lscown

Either has been fixed, or it was my fault. It's working now.

lscown avatar Feb 19 '24 03:02 lscown

Reopening, as it's reappeared. I believe this is a Postman issue.

lscown avatar Feb 20 '24 01:02 lscown

@lscown Hey, thanks for reaching out. Unfortunately I've not be able to replicate this. Can you help me out with a bit more info:

  1. Is this happening only on uploaded files or local file also?
  2. Does this happen for any specific file (large content?) or all files?
  3. Can you try sending the request to an echo endpoint like https://postman-echo.com/post and see if the headers are getting sent correctly?
  4. Are there any request settings that you're updated which might be causing this? I see the "Settings" tab seems to be modified in the screenshot that you shared.
  5. Any screen recording that you can share which might help debug this faster would be great as well.

coditva avatar Feb 20 '24 10:02 coditva

Hi @coditva - it's incredibly sporadic how it occurs, it's currently replicated in my environment. Hopefully this is enough context, please let me know if you'd like anything else.

  1. After trying it - it works when it's a local file, but does not when it's a team uploaded file. FWIW this is an uploaded .webm video. However, it works for both in the desktop app (local + web). Not entirely sure that this is the issue, but when I switch between files, the local one works.
  2. I realise it's only occuring on the .webm I uploaded. However, it has worked prior and sent through data. All other files seem to work, it's just the specific one that only sometimes works.
  3. Just tried this - and my suspicions are correct, there's no Content-Type header that is sent (see images)
  4. The cookie jar was disabled, the default setting changes nothing
  5. (Screenshots) - my POST to https://postman-echo.com/post:
Screenshot 2024-02-21 at 12 27 16 PM Screenshot 2024-02-21 at 12 27 25 PM Screenshot 2024-02-21 at 12 30 00 PM

lscown avatar Feb 20 '24 23:02 lscown

I had the same issue today. Screenshot from 2024-09-17 14-11-54

Screenshot from 2024-09-17 14-21-30

(Pdb) request.headers {'Authorization': 'Bearer ', 'User-Agent': 'PostmanRuntime/7.35.0', 'Accept': '/', 'Cache-Control': 'no-cache', 'Postman-Token': 'e344c14d-3dee-40c6-b84e-fe39fc0bfc89', 'Host': 'localhost:8000', 'Accept-Encoding': 'gzip, deflate, br', 'Connection': 'keep-alive', 'Content-Length': '0'}

If I add non-file variables to the body, the content-type is set.

Notice the Postman version in User-Agent also do not match.

alanoe avatar Sep 17 '24 17:09 alanoe

This problem is also happening quite consistently with me. Usually works as usual in the first 10-20 minutes of request creation but after a while it starts to happen over and over again.

williankl avatar May 08 '25 15:05 williankl

I had this exact issue after I duplicated a tab with the file references already set. The original tab was still working correctly but the duplicate tab did not. Once I deleted and re-added the file references, it worked as intended.

williamkunz avatar Jun 18 '25 18:06 williamkunz

Same here, got the same issue after duplicating a request, and the fix was removing the file and then adding it back.

It is also happening after restarting Postman.

RaniAgus avatar Aug 28 '25 12:08 RaniAgus