introduce string_view
This commit is contained in:
@@ -61,13 +61,13 @@ public:
|
||||
return *this;
|
||||
}
|
||||
|
||||
ResponseBuilder& MediaType(const std::string& media_type) {
|
||||
media_type_ = media_type;
|
||||
ResponseBuilder& MediaType(string_view media_type) {
|
||||
media_type_ = ToString(media_type);
|
||||
return *this;
|
||||
}
|
||||
|
||||
ResponseBuilder& Charset(const std::string& charset) {
|
||||
charset_ = charset;
|
||||
ResponseBuilder& Charset(string_view charset) {
|
||||
charset_ = ToString(charset);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -98,11 +98,7 @@ public:
|
||||
ResponseBuilder& File(const fs::path& path, bool infer_media_type = true,
|
||||
std::size_t chunk_size = 1024);
|
||||
|
||||
ResponseBuilder& Header(const std::string& key, const std::string& value) {
|
||||
headers_.push_back(key);
|
||||
headers_.push_back(value);
|
||||
return *this;
|
||||
}
|
||||
ResponseBuilder& Header(string_view key, string_view value);
|
||||
|
||||
// Add the `Date` header to the response.
|
||||
ResponseBuilder& Date();
|
||||
|
||||
Reference in New Issue
Block a user