What I need is a way to go back to the top of the method is a special event is triggered, here's my code in C#
public void SendRequest()
{
send:
{
var response = new RequestBuilder("https://google.com").
WithMethod(HttpMethod.GET).
Send();
if (response.Contains("Special Keyword"))
goto send;
// Continue..
}
}
This code works in C#, it resend the request until the page doesn't contains "Special Keyword"
Any idea of how I can do the same thing in Java?
Here's what I tried, but even if the page contains "Special Keyword" it ends up saying "Done"
public void SendRequest() {
send: {
String response = new RequestBuilder().
to("https://google.com").
buildAndSend().
toString();
if(response.contains("Special Keyword"))
break send;
// Continue..
System.out.println("Done");
}
}