SUM
SUM

Reputation: 1661

From web browser send http request multiple times

For testing purpose I want to send same http request multiple times from a web browser so that I can test the response using browser and not use a CURL command.

Is there a way to do this from the web browser?

e.g:

http://abcxyz.com/style?font=sans

Send this request multiple times in web browser

Thanks

Upvotes: 0

Views: 524

Answers (1)

Chiguireitor
Chiguireitor

Reputation: 3316

This:

<script>
var url = "http://abcxyz.com/style?font=sans";

for (var i=0; i < 10; i++) {
  var xhr = XMLHttpRequest();
  xhr.open(url, true);
  xhr.send();
}
</script>

Sends 10 request to the aforementioned URL.

Upvotes: 1

Related Questions