Currently, my focus is on JAVA programming.
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
System.out.println("TEST TOMCAT SERVLET");
StringBuilder data = new StringBuilder();
String s;
while ((s = request.getReader().readLine()) != null) {
data.append(s);
}
data.toString(); //Incoming Data
}
Upon initializing the application, I see the following message in the Servlet: "TEST TOMCAT SERVLET". However, I am not receiving the following:
return fetch(PUSH_ENDPOINT, {
method: 'POST',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({
token: token,
user: 'Brent'
})
});
}