【问题标题】:How to response with MIME code on oat++ endpoint如何在 oat++ 端点上使用 MIME 代码进行响应
【发布时间】:2021-10-25 10:25:28
【问题描述】:

如何在端点响应上设置 MIME 代码?

我没有看到任何可用的文档。

【问题讨论】:

    标签: oat++


    【解决方案1】:

    您只需在响应中添加一个Content-Type 标头:

    auto response = createResponse(Status::CODE_200, "OK");
    response->putHeader("Content-Type", "image/jpeg");
    return response;
    

    【讨论】:

      猜你喜欢
      • 2016-05-28
      • 1970-01-01
      • 2017-11-18
      • 1970-01-01
      • 2021-02-13
      • 1970-01-01
      • 2020-09-28
      • 2023-01-03
      • 2018-03-20
      相关资源
      最近更新 更多