【问题标题】:How to read data written in http.ResponseWriter [duplicate]如何读取用 http.ResponseWriter 写入的数据 [重复]
【发布时间】:2021-10-12 14:39:51
【问题描述】:

我正在寻找更新在 http.ResponseWriter 中写入的数据。

在 golang 中有什么方法,我们获取写入的 []byte 的指针/句柄并在服务请求之前对其进行更新?

【问题讨论】:

  • 不能保证所有写入的数据都在缓冲区中。在调用链的更高层实现您自己的响应编写器,以便您可以拦截写入调用。

标签: go


【解决方案1】:

在 golang 中有什么方法,我们获取写入的 []byte 的指针/句柄并在服务请求之前对其进行更新?

没有。

【讨论】:

    猜你喜欢
    • 2014-11-25
    • 2018-01-12
    • 2021-06-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-03-11
    • 2015-03-15
    • 1970-01-01
    相关资源
    最近更新 更多