MCPcopy Create free account
hub / github.com/Tiiny-AI/PowerInfer / serialize_multipart_formdata_item_begin

Function serialize_multipart_formdata_item_begin

examples/server/httplib.h:4268–4283  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4266
4267template <typename T>
4268inline std::string
4269serialize_multipart_formdata_item_begin(const T &item,
4270 const std::string &boundary) {
4271 std::string body = "--" + boundary + "\r\n";
4272 body += "Content-Disposition: form-data; name=\"" + item.name + "\"";
4273 if (!item.filename.empty()) {
4274 body += "; filename=\"" + item.filename + "\"";
4275 }
4276 body += "\r\n";
4277 if (!item.content_type.empty()) {
4278 body += "Content-Type: " + item.content_type + "\r\n";
4279 }
4280 body += "\r\n";
4281
4282 return body;
4283}
4284
4285inline std::string serialize_multipart_formdata_item_end() { return "\r\n"; }
4286

Callers 2

Calls 1

emptyMethod · 0.45

Tested by

no test coverage detected