apache / apache/jmeter

Facing error "Unsupported Media Type" while not sending the content-type in APIs header using JMeter

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

Description

### Expected behavior

JMeter should not append/add the content-type it self when it is not configured in header.

### Actual behavior

JMeter is sending a content-type automatically when it is not configured in the header and in the result an error occurred as APIs do not need the content type header with below error.

`{
"statusCode": 415,
"code": "FST_ERR_CTP_INVALID_MEDIA_TYPE",
"error": "Unsupported Media Type",
"message": "Unsupported Media Type: application/x-www-form-urlencoded; charset=UTF-8"
}`

### Steps to reproduce the problem

Create a JMeter test plan with a thread group and add a HTTP request type(Post, delete etc.) with header manager having no Content-type header.

### JMeter Version

5.6.2

### Java Version

openJDK version 17

### OS Version

Amazon linux 2

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.