Support response data streaming and add an example file downloader.

This commit is contained in:
Chunting Gu
2019-08-08 17:12:22 +08:00
parent 3077f21549
commit 0292b4b51e
19 changed files with 370 additions and 148 deletions
+6 -2
View File
@@ -26,10 +26,14 @@ public:
return body_;
}
// Get the data from the string body.
// Exception Error(kDataError) will be thrown if the body is FormBody.
// Get the data from the (string) body.
// Empty string will be returned if the body is not a StringBody.
const std::string& data() const;
// Get the body as a FileBody.
// Exception Error::kDataError will be thrown if the body is not a FileBody.
std::shared_ptr<FileBody> file_body() const;
// ---------------------------------------------------------------------------
void SetHeader(Header&& header) {