MCPcopy Create free account
hub / github.com/MITK/MITK / SendBinaryResponse

Method SendBinaryResponse

Modules/RESTAPI/src/mitkDataStorageController.cpp:495–502  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

493}
494
495void DataStorageController::SendBinaryResponse(httplib::Response& res, const std::string& data,
496 const std::string& filename)
497{
498 res.status = 200;
499 res.set_content(data, MIME_APPLICATION_OCTET_STREAM);
500 // Content-Disposition includes filename with extension; format can be derived from extension
501 res.set_header(HEADER_CONTENT_DISPOSITION, "attachment; filename=\"" + filename + "\"");
502}
503
504NodeQueryParams DataStorageController::ParseNodeQueryParams(const httplib::Request& req) const
505{

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected