Search code examples
jmeterperformance-testing

How to use different content type in jemter.


Scenario: I've two post requests in jmeter one is used for token generation which has content type "application/x-www-form-urlencoded" and second is used for xyz operation by using that token has content type application/json, how can i perform this in jmeter?


Solution

    1. For 1st request just make sure to choose POST value from the "Method" dropdown and make sure that Use multipart/form-data box is not ticked

      JMeter POST request

      JMeter will automatically send application/x-www-form-urlencoded request header for POST

      JMeter Headers urlencoded

    2. For 2nd request add a HTTP Header Manager as a child and configure it to send the required Content-Type header

      JMeter Content Type