Support data streaming on server side.

This commit is contained in:
Chunting Gu
2019-08-13 17:35:01 +08:00
parent 0ea4ab7526
commit 9b13dceab9
13 changed files with 167 additions and 59 deletions
+7
View File
@@ -13,6 +13,13 @@ public:
virtual ~View() = default;
virtual ResponsePtr Handle(RequestPtr request) = 0;
// Return true if you want the request data of the given method to be streamed
// to a temp file. Data streaming is useful for receiving large data, e.g.,
// a JPEG image, posted from the client.
virtual bool Stream(const std::string& /*method*/) {
return false; // No streaming by default
}
};
using ViewPtr = std::shared_ptr<View>;