In groovy, is there a way to send a request to a URL ignoring the response? The main task is to send more requests to the server in a shorter period of time.
As a result, it doesn’t matter to me as soon as the request is sent, I don’t want the script to wait for a response before continuing.
Here is my current script:
(1..50).each { element-> def url = "http://someUrl" url.toURL().text }
In this code, the text method should load the whole answer, which is really uninteresting to me. The important part is that the request is sent, and waiting for a response does not matter.
Is there a similar send method? (along the lines ..
url.toURL().send
Alternatively, is there a “groovy” way that I can speed up with GPARS to run the loop in parallel?
source share