I have a GET request in my API that can be called via url. My problem is that this request is waiting for some return, even though it may take indefinitely. I would like to return a 200 status code right at the beginning of the application so that the user does not have his page blocked waiting for a response, while the rest of the code is executed normally.
My actual code look like this:
@Controller
public class APITest {
@RequestMapping(value="test", method=RequestMethod.GET)
public void RequestTest(
@RequestParam(value="token", required=false) String token,
HttpServletRequest request, HttpServletResponse response)
throws InterruptedException, ParseException, IOException, SQLException {
// SOME CODE HERE
return;
}
}
Is what I need possible using this method?