Add auto test for client timeout.
This commit is contained in:
@@ -51,23 +51,6 @@ RequestPtr RequestBuilder::operator()() {
|
||||
return request;
|
||||
}
|
||||
|
||||
RequestBuilder& RequestBuilder::Url(const std::string& url, bool encode) {
|
||||
url_ = webcc::Url{ url, encode };
|
||||
return *this;
|
||||
}
|
||||
|
||||
RequestBuilder& RequestBuilder::Path(const std::string& path, bool encode) {
|
||||
url_.AppendPath(path, encode);
|
||||
return *this;
|
||||
}
|
||||
|
||||
RequestBuilder& RequestBuilder::Query(const std::string& key,
|
||||
const std::string& value,
|
||||
bool encode) {
|
||||
url_.AppendQuery(key, value, encode);
|
||||
return *this;
|
||||
}
|
||||
|
||||
RequestBuilder& RequestBuilder::File(const webcc::Path& path,
|
||||
bool infer_media_type,
|
||||
std::size_t chunk_size) {
|
||||
|
||||
+22
-3
@@ -66,14 +66,33 @@ public:
|
||||
return Method(methods::kPatch).Url(url, encode);
|
||||
}
|
||||
|
||||
RequestBuilder& Url(const std::string& url, bool encode = false);
|
||||
RequestBuilder& Url(const std::string& url, bool encode = false) {
|
||||
url_ = webcc::Url{ url, encode };
|
||||
return *this;
|
||||
}
|
||||
|
||||
RequestBuilder& Port(const std::string& port) {
|
||||
url_.set_port(port);
|
||||
return *this;
|
||||
}
|
||||
|
||||
RequestBuilder& Port(std::uint16_t port) {
|
||||
url_.set_port(std::to_string(port));
|
||||
return *this;
|
||||
}
|
||||
|
||||
// Append a piece to the path.
|
||||
RequestBuilder& Path(const std::string& path, bool encode = false);
|
||||
RequestBuilder& Path(const std::string& path, bool encode = false) {
|
||||
url_.AppendPath(path, encode);
|
||||
return *this;
|
||||
}
|
||||
|
||||
// Append a parameter to the query.
|
||||
RequestBuilder& Query(const std::string& key, const std::string& value,
|
||||
bool encode = false);
|
||||
bool encode = false) {
|
||||
url_.AppendQuery(key, value, encode);
|
||||
return *this;
|
||||
}
|
||||
|
||||
RequestBuilder& MediaType(const std::string& media_type) {
|
||||
media_type_ = media_type;
|
||||
|
||||
@@ -75,6 +75,10 @@ public:
|
||||
return query_;
|
||||
}
|
||||
|
||||
void set_port(const std::string& port) {
|
||||
port_ = port;
|
||||
}
|
||||
|
||||
// Append a piece of path.
|
||||
void AppendPath(const std::string& piece, bool encode = false);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user