Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Send both parameters and Body data with JMeter HTTP request

Tags:

jmeter

I need to send POST requests to an API server for which I need to send the following information: Server:

  • exampleapiserver.com

Methods:

  • method1
  • method2
  • etc

Parameters:

  • apikey: {apikey}
  • env:{environment}

Headers:

  • header1:{header1}
  • header2:{header2}
  • header3:{header3}

Body data: {

  • "bodydata1":{bodydata1}
  • "bodydata2":{bodydata2}
  • "bodydata3":{bodydata3}

}

The thing is that I can't send them both, both the parameters for the API server and the body data, and one with the other doesn't work.

As a workaround to make it happen, I used in my HTTP Request for the path the url with parameters, like this:

Server name or IP: exampleapiserver.com

Path: /method1?apikey=apiserverkey&env=test

and in the body data I've put the actual body data.

Can this be achieved in a different way, not to be forced to use the parameters in the URL so that I can send the body data too?

like image 519
Cosmin Avatar asked Oct 19 '22 01:10

Cosmin


1 Answers

The way you did it is ok. As of jmeter 2.13 there is no other way to do it.

like image 126
UBIK LOAD PACK Avatar answered Jan 04 '23 06:01

UBIK LOAD PACK