The error should have had more information than just a response code. Can you please include the entire response?
On Mon, Jul 18, 2016 at 8:27 AM, <[email protected]> wrote: > Hello, I trying to write in Influxdb with a C# application and it does not > working correctly. Could you provide me some examples or tell me where > could I find them? > This is my code: > > public static void writeInflush() { > NameValueCollection queryString = > HttpUtility.ParseQueryString(string.Empty); > queryString[""] = "pm_ccc"; > queryString["pm"] = "0043P"; > queryString["env_cecre"] = "1"; > queryString["valor"] = "127.3"; > queryString["calidad"] = "0"; > queryString["origen"] = "auto"; > String parametros = queryString.ToString(); > enviarInflush("http://dbserv3:8086/write?db=PRUEBA", parametros); > } > > public static String enviarInflush(String url, String param) { > try { > // create a request > HttpWebRequest request = (HttpWebRequest)WebRequest.Create(new Uri(url)); > request.Accept = "*/*"; > request.ContentType = "*/*"; > request.Method = "POST"; > request.ContentLength = param.Length; > UTF8Encoding encoding = new UTF8Encoding(); > Byte[] bytes = encoding.GetBytes(param); > > Stream str = request.GetRequestStream(); > str.Write(bytes, 0, bytes.Length); > str.Close(); > > HttpWebResponse response = (HttpWebResponse)request.GetResponse(); > StreamReader strRd = new StreamReader(response.GetResponseStream()); > string result = strRd.ReadToEnd(); > > return result; > } catch (Exception e) { > return e.StackTrace; > } > } > > The error code is 400. Any idea? Thanks, > > -- > Remember to include the InfluxDB version number with all issue reports > --- > You received this message because you are subscribed to the Google Groups > "InfluxDB" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/influxdb. > To view this discussion on the web visit > https://groups.google.com/d/msgid/influxdb/f81752e0-fedf-47f0-90fd-d2a068b063cc%40googlegroups.com > . > For more options, visit https://groups.google.com/d/optout. > -- Sean Beckett Director of Support and Professional Services InfluxDB -- Remember to include the InfluxDB version number with all issue reports --- You received this message because you are subscribed to the Google Groups "InfluxDB" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/influxdb. To view this discussion on the web visit https://groups.google.com/d/msgid/influxdb/CALGqCvMiNBn%2BntA03wNLEb2dMiKa_tunO7CUEmdZqwVjZt%3DXDg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
