Add SSE style subscription support to eventservice

This commit adds the SSE style eventservice subscription style event
Using this, end user can subscribe for Redfish event logs using GET
on SSE uris from browser.

Tested:
 - From Browser did GET on above SSE URI and
   generated some Redfish event logs(power cycle)
   and saw redfish event logs streaming on browser.
 - After SSE registration, Check Subscription collections
   and GET on individual subscription and saw desired
   response.
 - Ran RedfishValidation and its passed.

Change-Id: I7f4b7a34974080739c4ba968ed570489af0474de
Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com>
Signed-off-by: P Dheeraj Srujan Kumar <p.dheeraj.srujan.kumar@intel.com>
Signed-off-by: Ed Tanous <edtanous@google.com>
diff --git a/http/http_client.hpp b/http/http_client.hpp
index 7a98b54..dea4d50 100644
--- a/http/http_client.hpp
+++ b/http/http_client.hpp
@@ -710,7 +710,7 @@
         }
     }
 
-    void sendData(std::string& data, const std::string& destUri,
+    void sendData(std::string&& data, const std::string& destUri,
                   const boost::beast::http::fields& httpHeader,
                   const boost::beast::http::verb verb,
                   const std::function<void(Response&)>& resHandler)
@@ -866,19 +866,19 @@
 
     // Send a request to destIP:destPort where additional processing of the
     // result is not required
-    void sendData(std::string& data, const std::string& destIP,
+    void sendData(std::string&& data, const std::string& destIP,
                   uint16_t destPort, const std::string& destUri, bool useSSL,
                   const boost::beast::http::fields& httpHeader,
                   const boost::beast::http::verb verb)
     {
         const std::function<void(Response&)> cb = genericResHandler;
-        sendDataWithCallback(data, destIP, destPort, destUri, useSSL,
+        sendDataWithCallback(std::move(data), destIP, destPort, destUri, useSSL,
                              httpHeader, verb, cb);
     }
 
     // Send request to destIP:destPort and use the provided callback to
     // handle the response
-    void sendDataWithCallback(std::string& data, const std::string& destIP,
+    void sendDataWithCallback(std::string&& data, const std::string& destIP,
                               uint16_t destPort, const std::string& destUri,
                               bool useSSL,
                               const boost::beast::http::fields& httpHeader,
@@ -897,7 +897,7 @@
         }
         // Send the data using either the existing connection pool or the newly
         // created connection pool
-        pool.first->second->sendData(data, destUri, httpHeader, verb,
+        pool.first->second->sendData(std::move(data), destUri, httpHeader, verb,
                                      resHandler);
     }
 };