smicyk / groovy-jmeter

A Groovy-based DSL for building and running JMeter test plans from command line and more.
Apache License 2.0
13 stars 1 forks source link

[Q] How to express POST requests that have both QueryString and PostData Params #71

Closed AntonioSun closed 2 years ago

AntonioSun commented 2 years ago

How to express HTTP POST requests that have both QueryString and PostData Params?

Here is a sample from my .har file:

image

thanks

smicyk commented 2 years ago

Hi, I think the implementation in JMeter forces to send either post data or query parameters (at least when you use the tabs Parameters and Body Data). However you can still define your parameters as a part of path parameter, assuming you are using the long form for http keyword e.g.

// path contains query string param
http path: '/endpoing?myparam=value1', method: 'POST', {
    // post data params
    params {
        param(name: 'username', value: 'john')
        param(name: 'password', value: 'john')
    }
} 
AntonioSun commented 2 years ago

gotcha. thx!