Hi,
I am trying to write multiple data points into InfluxDb using the web API. I can write a single point to the influxDb (Like replacing the command with the first half “Measurements,device=601 value=0.8,value2=120.5,value3=60.007”) but when I tried to build a line command to write multiple data points, I got the error returned by the influxDb:“{"error":"partial write: unable to parse ‘Measurements,device=601 value=0.8,value2=120.5,value3=60.007\r’: invalid number dropped=0"}\n”
Here’s my code in c#:
static async Task MainAsync()
{
using (var client = new HttpClient())
{
client.BaseAddress = new Uri(“http://localhost:8086”);
var content = new ByteArrayContent(Encoding.ASCII.GetBytes(“Measurements,device=601 value=0.8,value2=120.5,value3=60.007\r\nMeasurements,device=601 value=0.8,value2=120.5,value3=60.008”));
var result = await client.PostAsync(“/write?db=data”, content);
string resultContent = await result.Content.ReadAsStringAsync();
Console.WriteLine(resultContent);
}
}
I am new to InfluxDB and I am not sure if using the web API is the right way to write multiple data points. Any comment is welcomed