apache / apache/jmeter

Facing issue with "content-type" header in HTTP Header Manager Using JMeter 5.5 version.

Open
#5,897 10 comments 0 reactions 0 assignees View on GitHub
defect help-wanted to-triage
Dominant language
Java
Stars
9.5k
Forks
2.3k
Avg merge
1d 22h
Merged PRs (30d)
5

Description

### Expected behavior

File upload with https POST request should work fine with JMeter 5.5 when Header Manager content-type is set to application/json.

### Actual behavior

_No response_

### Steps to reproduce the problem

I have https POST request, with file upload option.
Header Manager has content-type set to application/json:
image
Once the request is being sent, getting below error:
{"timestamp":"2023-05-08T09:17:39.942+00:00","path":"/EndPoint/URL","status":400,"error":"Bad Request","message":"Invalid value for header 'content-type'. Expected: 'application/json + Given: multipart/form-data; boundary=JAeP7VH8u1DA8_a_3mg51MC70D1STLj","requestId":"ID"}
In Request Headers, content-type is automatically getting set to multipart/form-data even when it is set to application/json in header manager.
image
Note: The above error is observed with latest JMeter version i.e. 5.5.
With the older version of JMeter **5.3** the same https request works fine.

### JMeter Version

5.5

### Java Version

openjdk version "1.8.0_362"

### OS Version

OEL 7.9

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.