سؤال

The device sends an HTTP PUT request to the tomcat server.And server response '200(OK) status code to indicate success. But I don't know how to receive and response using tomcat .Thanks for any help very much.

هل كانت مفيدة؟

المحلول

You need to read the response body via ServletRequest.getInputStream() or ServletRequest.getReader(). There is no need to set the response code, it will be 200 by default unless an error occurs. You might want to send a response body. See Tomcat's DefaultServlet for how it implements PUT (note that it is disabled by default for security reasons).

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top