Closed fyr233 closed 7 months ago
When using post_http and using usr and pwd in server_info,
influxdb_cpp::server_info si("127.0.0.1", 8086, "db", "usr", "pwd"); std::string resp; influxdb_cpp::builder() .meas("foo") .tag("k", "v") .tag("x", "y") .field("x", 10) .field("y", 10.3, 2) .field("z", 10.3456) .field("b", !!10) .timestamp(1512722735522840439) .post_http(si, &resp);
&resp will get 401 {"error":"unable to parse authentication credentials"}
&resp
401 {"error":"unable to parse authentication credentials"}
Maybe the condition si.token_.empty() in code here has problem:
si.token_.empty()
When I replace si.token_.empty() with !si.token_.empty(), it works.
!si.token_.empty()
Thanks a ton to your feedback.
When using post_http and using usr and pwd in server_info,
&resp
will get401 {"error":"unable to parse authentication credentials"}
Maybe the condition
si.token_.empty()
in code here has problem:When I replace
si.token_.empty()
with!si.token_.empty()
, it works.