For the first time, according to the official website to write.Why, always an error.Please, give me a correct way.Thank you very much.
String url = "http://localhost:8086/db/mydb/series?u=admin&p=123456"; URL obj = new URL(url); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); //add reuqest header con.setRequestMethod("POST"); con.setRequestProperty("Accept-Language", "en-US,en;q=0.5"); String urlParameters = "[{\"name\": \"log_lines\",\"columns\": [\"time\", \"line\"],\"points\": [[1400425947368, \"here's some useful log info\"]]}]"; //很严格 // Send post request con.setDoOutput(true); int responseCode = con.getResponseCode(); System.out.println("\nSending 'POST' request to URL : " + url); System.out.println("Post parameters : " + urlParameters); System.out.println("Response Code : " + responseCode); BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream())); DataOutputStream wr = new DataOutputStream(con.getOutputStream()); wr.writeBytes(urlParameters); String inputLine; -- 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/93287adf-3f20-4e10-8573-626fe748fe5c%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
