   if (client.connected()) {
     Serial.println(F("done."));
     
-    String body = F("{\"time\":0,\"temp\":20}");
-    String request = F("POST /temp_gauge/reading HTTP/1.1\r\n"
+    String body = F("{\"time\":");
+    body += currentTime;
+    body += F("000,\"temp\":"); // currentTime is in seconds, need milliseconds
+    body += currentTemp;
+    body += F("}");
+    
+    String head = F("POST /temp_gauge/reading HTTP/1.1\r\n"
     "Host: fremont:9200\r\n"
     "Content-Length: ");
-    request += body.length();
-    request += "\r\n\r\n";
-    
-    request += body;
+    head += body.length();
+    head += F("\r\n\r\n");
     
     Serial.println(F("Request:"));
-    Serial.println(request.c_str());
+    Serial.print(head.c_str());
+    Serial.println(body.c_str());
     
     Serial.print(F("Sending request... "));
-    client.fastrprint(request.c_str());
+    client.fastrprint(head.c_str());
+    client.fastrprint(body.c_str());
     Serial.println(F("done."));
   } else {
     Serial.println(F("Connection failed"));    

  // Update the current time.
  // Note: If the sketch will run for more than ~24 hours, you probably want to query the time
  // server again to keep the current time from getting too skewed.
  unsigned long currentTime = lastPolledTime + (millis() - sketchTime);

  Serial.print(F("Starting read. Current time: ")); Serial.println(currentTime);
  lastReading = currentTime;

OneWire ds(8);  // on pin 8

// State used to keep track of the current time and time since last temp reading.
unsigned long unixTimeAtStart = 0;   // Last value retrieved from time server
unsigned long sketchTimeAtStartMillis = 0;       // CPU milliseconds since last server query
unsigned long lastReading = 0;      // Time of last temperature reading.

void setup(void) {
