Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Jmeter I am trying to send a post rest api request containing json in body and getting unsupported media 415

Tags:

json

rest

jmeter

I am using Jmeter in order to send a request:

POST http://192.168.56.100:9080/agent/v1/target

POST data:
{  
   "eventsServers":"192.168.56.100:9999",
   "targetType":"kafka"
}

I am getting the following error: {"code":415,"message":"HTTP 415 Unsupported Media Type"} when I am running it from another rest api tool I am not getting this error

what could be the problem ?

like image 259
ErezN Avatar asked Aug 30 '25 16:08

ErezN


1 Answers

Just add a HTTP Header Manager to your Test Plan and configure it to send Content-Type header with the value of application/json

JMeter Header Manager Content Type

Check out Testing SOAP/REST Web Services Using JMeter article for more information on setting up a web service load test with JMeter

like image 134
Dmitri T Avatar answered Sep 02 '25 04:09

Dmitri T