Rename FileBody to HttpBody

Now that our custom body type does things more than files, it makes
sense to rename it.  This commit renames the header itself, then all
instances of the class.

Tested: Basic GET requests succeed.
Change-Id: If4361ac8992fc7c268f48a336707f96e68d3576c
Signed-off-by: Ed Tanous <ed@tanous.net>
diff --git a/http/http2_connection.hpp b/http/http2_connection.hpp
index 97dcf4e..ed37480 100644
--- a/http/http2_connection.hpp
+++ b/http/http2_connection.hpp
@@ -39,7 +39,7 @@
 {
     Request req{};
     Response res{};
-    std::optional<bmcweb::FileBody::writer> writer;
+    std::optional<bmcweb::HttpBody::writer> writer;
 };
 
 template <typename Adaptor, typename Handler>
@@ -173,7 +173,7 @@
         }
         Http2StreamData& stream = it->second;
         crow::Response& res = stream.res;
-        http::response<bmcweb::FileBody>& fbody = res.response;
+        http::response<bmcweb::HttpBody>& fbody = res.response;
         stream.writer.emplace(fbody.base(), fbody.body());
 
         nghttp2_data_provider dataPrd{
diff --git a/http/http_file_body.hpp b/http/http_body.hpp
similarity index 98%
rename from http/http_file_body.hpp
rename to http/http_body.hpp
index 17554a4..84351ee 100644
--- a/http/http_file_body.hpp
+++ b/http/http_body.hpp
@@ -14,7 +14,7 @@
 
 namespace bmcweb
 {
-struct FileBody
+struct HttpBody
 {
     class writer;
     class reader;
@@ -27,7 +27,7 @@
     Base64,
 };
 
-class FileBody::value_type
+class HttpBody::value_type
 {
     boost::beast::file_posix fileHandle;
     std::optional<size_t> fileSize;
@@ -155,7 +155,7 @@
     }
 };
 
-class FileBody::writer
+class HttpBody::writer
 {
   public:
     using const_buffers_type = boost::asio::const_buffer;
@@ -236,7 +236,7 @@
     }
 };
 
-class FileBody::reader
+class HttpBody::reader
 {
     value_type& value;
 
diff --git a/http/http_client.hpp b/http/http_client.hpp
index 6f42f3e..2d03487 100644
--- a/http/http_client.hpp
+++ b/http/http_client.hpp
@@ -16,6 +16,7 @@
 #pragma once
 
 #include "async_resolve.hpp"
+#include "http_body.hpp"
 #include "http_response.hpp"
 #include "logging.hpp"
 #include "ssl_key_handler.hpp"
@@ -116,10 +117,10 @@
 
 struct PendingRequest
 {
-    boost::beast::http::request<bmcweb::FileBody> req;
+    boost::beast::http::request<bmcweb::HttpBody> req;
     std::function<void(bool, uint32_t, Response&)> callback;
     PendingRequest(
-        boost::beast::http::request<bmcweb::FileBody>&& reqIn,
+        boost::beast::http::request<bmcweb::HttpBody>&& reqIn,
         const std::function<void(bool, uint32_t, Response&)>& callbackIn) :
         req(std::move(reqIn)),
         callback(callbackIn)
@@ -138,8 +139,8 @@
     uint32_t connId;
 
     // Data buffers
-    http::request<bmcweb::FileBody> req;
-    using parser_type = http::response_parser<bmcweb::FileBody>;
+    http::request<bmcweb::HttpBody> req;
+    using parser_type = http::response_parser<bmcweb::HttpBody>;
     std::optional<parser_type> parser;
     boost::beast::flat_static_buffer<httpReadBufferSize> buffer;
     Response res;
@@ -733,7 +734,7 @@
                   const std::function<void(Response&)>& resHandler)
     {
         // Construct the request to be sent
-        boost::beast::http::request<bmcweb::FileBody> thisReq(
+        boost::beast::http::request<bmcweb::HttpBody> thisReq(
             verb, destUri.encoded_target(), 11, "", httpHeader);
         thisReq.set(boost::beast::http::field::host,
                     destUri.encoded_host_address());
diff --git a/http/http_connection.hpp b/http/http_connection.hpp
index ed3dc07..d60e74b 100644
--- a/http/http_connection.hpp
+++ b/http/http_connection.hpp
@@ -5,6 +5,7 @@
 #include "authentication.hpp"
 #include "complete_response_fields.hpp"
 #include "http2_connection.hpp"
+#include "http_body.hpp"
 #include "http_response.hpp"
 #include "http_utility.hpp"
 #include "logging.hpp"
@@ -611,8 +612,8 @@
     Handler* handler;
     // Making this a std::optional allows it to be efficiently destroyed and
     // re-created on Connection reset
-    std::optional<boost::beast::http::request_parser<bmcweb::FileBody>> parser;
-    std::optional<boost::beast::http::response_serializer<bmcweb::FileBody>>
+    std::optional<boost::beast::http::request_parser<bmcweb::HttpBody>> parser;
+    std::optional<boost::beast::http::response_serializer<bmcweb::HttpBody>>
         serializer;
 
     boost::beast::flat_static_buffer<8192> buffer;
diff --git a/http/http_request.hpp b/http/http_request.hpp
index 9cd4a0c..ee940d6 100644
--- a/http/http_request.hpp
+++ b/http/http_request.hpp
@@ -1,6 +1,7 @@
 #pragma once
 
 #include "common.hpp"
+#include "http_body.hpp"
 #include "sessions.hpp"
 
 #include <boost/asio/io_context.hpp>
@@ -8,7 +9,6 @@
 #include <boost/beast/http/message.hpp>
 #include <boost/beast/websocket.hpp>
 #include <boost/url/url.hpp>
-#include <http_file_body.hpp>
 
 #include <string>
 #include <string_view>
@@ -19,7 +19,7 @@
 
 struct Request
 {
-    boost::beast::http::request<bmcweb::FileBody> req;
+    boost::beast::http::request<bmcweb::HttpBody> req;
 
   private:
     boost::urls::url urlBase{};
@@ -33,7 +33,7 @@
     std::shared_ptr<persistent_data::UserSession> session;
 
     std::string userRole{};
-    Request(boost::beast::http::request<bmcweb::FileBody> reqIn,
+    Request(boost::beast::http::request<bmcweb::HttpBody> reqIn,
             std::error_code& ec) :
         req(std::move(reqIn))
     {
diff --git a/http/http_response.hpp b/http/http_response.hpp
index dca7682..afd51c1 100644
--- a/http/http_response.hpp
+++ b/http/http_response.hpp
@@ -1,5 +1,5 @@
 #pragma once
-#include "http_file_body.hpp"
+#include "http_body.hpp"
 #include "logging.hpp"
 #include "utils/hex_utils.hpp"
 
@@ -23,7 +23,7 @@
     template <typename Adaptor, typename Handler>
     friend class crow::Connection;
 
-    http::response<bmcweb::FileBody> response;
+    http::response<bmcweb::HttpBody> response;
 
     nlohmann::json jsonValue;
     using fields_type = http::header<false, http::fields>;
diff --git a/http/server_sent_event.hpp b/http/server_sent_event.hpp
index 730bdce..a8bccdb 100644
--- a/http/server_sent_event.hpp
+++ b/http/server_sent_event.hpp
@@ -1,4 +1,5 @@
 #pragma once
+#include "http_body.hpp"
 #include "http_request.hpp"
 #include "http_response.hpp"
 
@@ -272,7 +273,7 @@
 
     Adaptor adaptor;
 
-    using BodyType = bmcweb::FileBody;
+    using BodyType = bmcweb::HttpBody;
     boost::beast::http::response<BodyType> res;
     std::optional<boost::beast::http::response_serializer<BodyType>> serializer;
     boost::asio::io_context& ioc;
diff --git a/http/websocket.hpp b/http/websocket.hpp
index 388a3e4..d232c02 100644
--- a/http/websocket.hpp
+++ b/http/websocket.hpp
@@ -1,5 +1,6 @@
 #pragma once
 #include "async_resp.hpp"
+#include "http_body.hpp"
 #include "http_request.hpp"
 
 #include <boost/asio/buffer.hpp>
@@ -128,7 +129,7 @@
         }));
 
         // Make a pointer to keep the req alive while we accept it.
-        using Body = boost::beast::http::request<bmcweb::FileBody>;
+        using Body = boost::beast::http::request<bmcweb::HttpBody>;
         std::unique_ptr<Body> mobile = std::make_unique<Body>(req.req);
         Body* ptr = mobile.get();
         // Perform the websocket upgrade
@@ -227,7 +228,7 @@
 
     void acceptDone(const std::shared_ptr<Connection>& /*self*/,
                     const std::unique_ptr<
-                        boost::beast::http::request<bmcweb::FileBody>>& /*req*/,
+                        boost::beast::http::request<bmcweb::HttpBody>>& /*req*/,
                     const boost::system::error_code& ec)
     {
         if (ec)