基本实现功能
This commit is contained in:
1 parent
bf9496e702
commit
28206cd50e
3 files changed
+85
-118
No files matched your search
@@ -53,7 +53,7 @@ namespace seafile
|
||||
response.error.message));
|
||||
}
|
||||
|
||||
if (response.status_code != 200)
|
||||
if (response.status_code != 200 && response.status_code != 206)
|
||||
{
|
||||
return tl::make_unexpected(
|
||||
SeafileException(
|
||||
@@ -265,8 +265,12 @@ namespace seafile
|
||||
start ? std::to_string(*start) : "",
|
||||
end ? std::to_string(*end) : "");
|
||||
header.emplace("range", range);
|
||||
const auto response = cpr::Get(url, header);
|
||||
return parseResponse<std::string>(response);
|
||||
const auto& response = cpr::Get(url, header);
|
||||
if (response.status_code != 200 && response.status_code != 206) {
|
||||
return tl::make_unexpected(SeafileException{std::format("HTTP Error:{}", response.status_code)});
|
||||
}else {
|
||||
return response.text;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user