File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ void Influxdb::setBucket(String bucket) {
4747}
4848
4949/* *
50- * Set the influxDB port.
50+ * Set the influxDB port.
5151 * @param port v1.x uses 8086, v2 uses 9999
5252 */
5353void Influxdb::setPort (uint16_t port){
@@ -163,11 +163,21 @@ boolean Influxdb::write(String data) {
163163 Serial.print (" <-- Response: " );
164164 Serial.print (httpResponseCode);
165165
166+ #if defined(ESP32)
167+ if (http.getSize () > 0 ) {
168+ String response = http.getString ();
169+ Serial.println (" \" " + response + " \" " );
170+ }
171+ else {
172+ Serial.println ();
173+ }
174+ #else
166175 String response = http.getString ();
167176 Serial.println (" \" " + response + " \" " );
177+ #endif
168178
169179 boolean success;
170- if (httpResponseCode == 204 ) {
180+ if (httpResponseCode == HTTP_CODE_NO_CONTENT ) {
171181 success = true ;
172182 } else {
173183 Serial.println (" #####\n POST FAILED\n #####" );
You can’t perform that action at this time.
0 commit comments