I’m trying to make a simple POST request to a 3rd party that I don’t have any control. For some reason the headers that accept must be lower case, e.g: x-gp-api-key instead of X-Gp-Api-Key (which is how it is sent by k6 by default.
Is there a way to tell k6 to keep the “case” in my headers?
This is caused by the Go standard library’s
http package, which k6 uses to make requests. It’s usually not a problem, because headers are supposed to be case-insensitive, see this SO topic and the RFC links inside of it. It was also previously discussed in this k6 open issue and I’ll link to this topic there.
Unfortunately, I don’t think we have a workaround for this right now, sorry
We looked into this again and it’s more complicated than we originally realized, I’ve summarized the finding in this comment.
Thank you very much for jumping into this so quickly. I’ve read the comment and I understand that there’s not much left to do at this point except to try to solve it myself with xk6.