       {
           client.println();
       }
-
+      Serial.println("---"); 
+      Serial.println("service call to azure successful!");
+      Serial.println(verb);
+      Serial.println(uri); 
+      Serial.println(content);            
+      Serial.println("---"); 
       return true;
     }
   else {
     // if you couldn't make a connection:
+    Serial.println("---"); 
     Serial.println("connection to azure webservice failed");
+    Serial.println(verb);
+    Serial.println(uri);
+    Serial.println(content); 
+    Serial.println("---");    
     reconnetWifi();
     return false;
   }    


  return response.substring(idxHdrEnd + 4);
}


         Serial.print("motion detected at ");
         Serial.print(duration);
         Serial.println(" sec");                 
         delay(150);
         if (! String(rtc.getYear()).equals("0"))
         {
           timeStamp = getTimeStamp();
           Serial.println(timeStamp);   
           webServiceSucceeded = azureHttpPost("{deviceId:NeshMKR100Dev1, motion:1,timestamp:" + timeStamp + "}");
           //webServiceSucceeded = httpRequest("POST", senduri,"text/plain","{deviceId:NeshMKR100Dev1, motion:1,timestamp:" + timeStamp + "}");
           if(webServiceSucceeded == false)
           {
            delay(150);
              Serial.println("retrying webservice call ");
              azureHttpPost("{deviceId:NeshMKR100Dev1, motion:1,timestamp:" + timeStamp + "}");
              //httpRequest("POST", senduri,"text/plain","{deviceId:NeshMKR100Dev1, motion:1,timestamp:" + timeStamp + "}");
           }
           else
           {
             delay(1000);//delay at least 1 sec to allow web service to finish
           }
         }
    }
    
