tihomir-kit / InfluxData.Net

InfluxData TICK stack .net library.
MIT License
156 stars 52 forks source link

query with & or # cannot be encoded correctly in url and failed in query API #44

Closed micastle closed 7 years ago

micastle commented 7 years ago

my query is like this: select * from int_metrics where "host"='my O&O' limit 5

it works with influx.exe, but when call with the client, it reports failure due to url encoding is using Uri.EscapeUriString, which does not encode the character &. it happens in InfluxData.Net\InfluxData.Net.Common\Helpers\HttpUtility.cs, I suggest to use Uri.EscapeDataString to avoid this.

tihomir-kit commented 7 years ago

Thnx for the suggestion. Will test it and fix it up for the next version. It might also help with an issue with submitting regexes to influx api as well.

tihomir-kit commented 7 years ago

Just for the reference.

tihomir-kit commented 7 years ago

Alright, all test are still passing and it makes sense to use the EscapeDataString instead. Thanks for the suggestion and sorry for the wait. I'll deploy this tonight.

EDIT: published - v7.0.1