Sending 100 Continue using Java Servlet API

后端 未结 4 1574
小蘑菇
小蘑菇 2021-01-14 15:46

Is it possible to send \"100 Continue\" HTTP status code, and then later some other status code after processing entire request using Java Servlet API (HttpServletResponse)?

4条回答
  •  旧时难觅i
    2021-01-14 16:34

    Did you mean to ask How do I send a status code before the complete request is received, to interrupt an in-progress request due to a missing header field? It seems that's not possible with standard servlets.

    What server are you using?

    Some server's servlet extensions may allow this, e.g. Tomcat's Comet servlet might send EventType.BEGIN once the headers are available to process, which may allow you to interrupt a PUT that doesn't have the correct authentication.

    Alternatively your server might have a plugin to reject requests based on headers.

提交回复
热议问题