HTTP/Get query params

Hi there!
I want to send Get request of the following type:
And I also want to send some headers. Right now this looks like this:

let res = http.get(
  endpoint +"?parameter=VALUE",
  { headers: headers }

Is there any way to send parameter not attached to url, but as some part of params object?

There isn’t anything like that included in the k6 libs, but you can pretty easily write a query builder in JS like this:

import http from "k6/http";

function buildQuery(data) {
   const result = [];

    .forEach((key) => {
       const encode = encodeURIComponent;
       result.push(encode(key) + "=" + encode(data[key]));

   return result.join("&");

export default function () {
   let urlQuery = buildQuery({
    queryKey1: "someData",
    queryKey2: "1254@@&%!",

  const body = {
    bodyKey1: "bval1",
    bodyKey2: "bval2",
  let resp = http.put(
1 Like