jmeter
jmeter copied to clipboard
Facing error "Unsupported Media Type" while not sending the content-type in APIs header using JMeter
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