如何在 emscripten wget2 函数中获得 content-type 响应 header?

How to get content-type response header in emscripten wget2 functions?

OnLoad 我只获得了响应缓冲区,如何获得响应headers?

查看 wget2 API: http://kripken.github.io/emscripten-site/docs/api_reference/emscripten.h.html#c.emscripten_async_wget2_data

正在查看 source of emscripten_async_wget2_data, there are no calls to getResponseHeader or getAllResponseHeaders, so I suspect you cannot get access to the headers using emscripten_async_wget2_data

我的建议是不要将 Emscripten 提供的 API 用于 ajax,并使用 XMLHttpRequest (or favourite higher-level library), and use the techniques at Emscripten's Connecting C++ and Javascript pages 自己动手从 C++ 调出您自己的实现。