4

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 ?

ErezN
  • 669
  • 2
  • 13
  • 25

2 Answers2

8

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

Dmitri T
  • 159,985
  • 5
  • 83
  • 133
2

Add HTTP Header Manager to your thread group

Add Content-Type in Name and application/json in value

Add Content-Type in Name and application/json in value

Anj Raju
  • 606
  • 7
  • 7