Hi,
Is it possible to send a GET request without a User-Agent header (not even the default k6 or go header) with k6?
It seems like the get function automatically adds it if its not present in the options.
I’ve also tried to override it with CLI flag ‘–user-agent=’ but then I get the default go header.
I’d really appreciate your help.
Hi @eden123
This seems to work:
import http from "k6/http";
import { check } from "k6";
export default function() {
var url = "https://httpbin.test.loadimpact.com/get"
var res = http.get(url, {"headers": {"user-agent": ""}});
console.log(res.body)
}
Funny… I was really sure I’ve tried it
Good to know
Thanks a lot!