Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

如何设置cinatra::response的content-type呢?内置的类型远远不够 #236

Open
qianxiaoming opened this issue Nov 26, 2022 · 2 comments

Comments

@qianxiaoming
Copy link

目前的定义是:
enum class content_type { string, multipart, urlencoded, chunked, octet_stream, websocket, unknown, };
没有找到设置content type的接口,如果想设application/xml或者image/png这样的类型怎么办?

@qicosmos
Copy link
Owner

可以扩展一下哈,你能提一个pr把额外的这些content-type加上吗?

@qicosmos
Copy link
Owner

设置response的content-type可以通过resp.add_header("Content-Type", "application/octet-stream");

这种方式添加。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants