Add automation test for http client based on httpbin.org
This commit is contained in:
@@ -85,37 +85,4 @@ void HttpRequestBuilder::SetContent(HttpRequestPtr request,
|
||||
request->SetContent(std::move(data), true);
|
||||
}
|
||||
|
||||
//void HttpRequestBuilder::CreateFormData(std::string* data,
|
||||
// const std::string& boundary) {
|
||||
// for (auto& pair : files_) {
|
||||
// data->append("--" + boundary + kCRLF);
|
||||
//
|
||||
// // Content-Disposition header
|
||||
// data->append("Content-Disposition: form-data");
|
||||
// if (!pair.first.empty()) {
|
||||
// data->append("; name=\"" + pair.first + "\"");
|
||||
// }
|
||||
// if (!pair.second.file_name().empty()) {
|
||||
// data->append("; filename=\"" + pair.second.file_name() + "\"");
|
||||
// }
|
||||
// data->append(kCRLF);
|
||||
//
|
||||
// // Content-Type header
|
||||
// if (!pair.second.mime_type().empty()) {
|
||||
// data->append("Content-Type: " + pair.second.mime_type());
|
||||
// data->append(kCRLF);
|
||||
// }
|
||||
//
|
||||
// data->append(kCRLF);
|
||||
//
|
||||
// // Payload
|
||||
// data->append(pair.second.data());
|
||||
//
|
||||
// data->append(kCRLF);
|
||||
// }
|
||||
//
|
||||
// data->append("--" + boundary + "--");
|
||||
// data->append(kCRLF);
|
||||
//}
|
||||
|
||||
} // namespace webcc
|
||||
|
||||
@@ -94,7 +94,7 @@ public:
|
||||
return *this;
|
||||
}
|
||||
|
||||
HttpRequestBuilder& KeepAlive(bool keep_alive) {
|
||||
HttpRequestBuilder& KeepAlive(bool keep_alive = true) {
|
||||
keep_alive_ = keep_alive;
|
||||
return *this;
|
||||
}
|
||||
@@ -107,8 +107,6 @@ public:
|
||||
|
||||
private:
|
||||
void SetContent(HttpRequestPtr request, std::string&& data);
|
||||
|
||||
//void CreateFormData(std::string* data, const std::string& boundary);
|
||||
|
||||
private:
|
||||
std::string method_;
|
||||
|
||||
Reference in New Issue
Block a user