【发布时间】:2019-10-15 23:34:42
【问题描述】:
我正在使用 pythons 请求库来发出返回数组缓冲区的 get 请求。
当我使用 requests.get(url) 时,我最终得到的文本响应与我正在寻找的 arraybuffer 响应非常不同。
我可以用这个在 node/js 中得到 arraybuffer 响应
req.onload = function(event) {
var res = req.response;
console.log(res)
}
req.open("GET", url, true);
req.responseType = "arraybuffer";
res = req.send()
但是,如果 req.responseType = "arraybuffer" 被排除在外,我会得到不正确的文本响应,类似于在 python 中
这相当于 python 请求(或其他 python http 库)中的req.responseType = "arraybuffer"?
非常感谢
【问题讨论】:
标签: python python-requests http-headers