Where are the request method constants in the Servlet API?

后端 未结 6 740
猫巷女王i
猫巷女王i 2020-12-01 13:33

I want to write

if (POST.equals(req.getMethod()))

instead of

if (\"POST\".equals(req.getMethod()))

but I

6条回答
  •  感情败类
    2020-12-01 14:27

    Outside of the JDK, Apache Axis has a public constant for POST (but not for any of the other methods):

    org.apache.axis.transport.http.HTTPConstants.HEADER_POST

提交回复
热议问题