http服务器应该在发送响应之前读取请求正文吗? [英] Should http server read request body before sending a response?

查看:99
本文介绍了http服务器应该在发送响应之前读取请求正文吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

http服务器实现在发送响应之前是否有任何规则可以读取或跳过请求正文?

Is there any rule for http server implementation to read or skip the request body before sending a response?

推荐答案

一旦收到完整的HTTP请求,您就可以随意处理它.如果您不关心身体,则可以简单地阅读并丢弃它.您应该明显清空读取缓冲区.

Once you have received the full HTTP request you are free to do with it whatever you want to do with it. If you don't care about the body you can simply read it and discard it. You should empty the read buffer obviously.

这篇关于http服务器应该在发送响应之前读取请求正文吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆