     Serial.println("connection failed");
     return;
   }
+
+  // We now create a URI for the request
+  String body = "diastolic=";
+  body += diastolic;
+  body += "&systolic=";
+  body += systolic;
+  body += "&hr=";
+  body += hr;
+
+  String post = String("POST /api.php/bp HTTP/1.1\r\n") +
+               "Host: " + host + "\r\n" +
+               "Content-Type: text/plain\r\n" +
+               "Content-Length: " + body.length() + "\r\n\r\n" + // must be twice
+               body + "\r\n" +
+               "Connection: close";
+
+  Serial.println("Full request:");
+  Serial.println(post);
   
-  // We now create a URI for the request
-  String url = "/input/";
-  url += streamId;
-  url += "?private_key=";
-  url += privateKey;
-  url += "&diastolic=";
-  url += diastolic;
-  url += "&systolic=";
-  url += systolic;
-  url += "&hr=";
-  url += hr;  
-  
-  Serial.print("Requesting URL: ");
-  Serial.println(url);
-  
-  // This will send the request to the server
-  client.print(String("GET ") + url + " HTTP/1.1\r\n" +
-               "Host: " + host + "\r\n" + 
-               "Connection: close\r\n\r\n");
+  client.print(post);
   delay(10);
-  
+
   // Read all the lines of the reply from server and print them to Serial
-  while(client.available()){
+  while (client.available()) {
     String line = client.readStringUntil('\r');
-//    Serial.print(line);
-  }
-  
+    Serial.print(line);
+  }
+
   Serial.println();
   Serial.println("closing connection");
 }


    // Upload to data.sparkfun.com
    uploadMeasurements();
        
    // Store updated count in eeprom
    EEPROM.write(0x00, readCount);
    EEPROM.commit();
  
    // Blink led so user knows everything is dandy
    blinkLED();
    
    // Print it for debugging
    Serial.print("Your last measurement is ");
    Serial.print(systolic, DEC);

  Serial.println();
  Serial.print("Connecting to ");
  Serial.println(ssid);

  WiFi.begin(ssid, password);

  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }

  Serial.println("");
  Serial.println("WiFi connected");
  Serial.println("IP address: ");
  Serial.println(WiFi.localIP());

  // Turn the LED on (active low) so user knows WiFi is up
  digitalWrite(4, LOW);

  // We just need one byte, but 4 is the minimum.
  EEPROM.begin(4);
}
