Invalid Content Type: application/csv when using InfluxQL in InfluxDB 2.7

Why exactly do I receive the error in title for

Select "Simulation_Examples_Functions_Ramp3" FROM "TestThingInflux" where time >= '2025-11-03T21:42:35Z' and time <='2025-11-17T21:42:37Z'

and headers:

let headers = {
	Authorization: "Token xxxxxx",
	Accept: "application/csv"
};

request for /query endpoint in InfluxDB 2.7?

Bucket exists, data is there, and I assumed this would work.

image

Commenting that this is not an Influx 2.7 issue, but it’s more related to my HTTP client, which is doing some strange validation. I will add here the solution for the benefit of others.

The solution in my case:

  1. The HTTP client I’m using, ThingWorx, has a few services that allow executing REST requests. The one I used, GetText, a very typical service, expects exactly Content-type: text, and for anything else it throws the error I mentioned above. I needed to use the LoadBinary, which outputs a BLOB
  2. Converting the BLOB in a STRING is achieved with the following ThingWorx Service code:
blob = Resources["ContentLoaderFunctions"].LoadBinary(params);
let chars = [];
for (var j = 0; j < jresult.length; j++) {
    chars.push(String.fromCharCode(jresult[j]));
}
result = chars.join("");

Worth mentioning that splitting in rows was via “\n”.