How can I automatically http POST many files sequentially with a break?

115 Views Asked by At

for manual testing I want to send multiply files to my local server.

At the moment I'm using the firefox extension Poster. But it is a hassle, if you like me have some hundreds files and have to select every single file and post.

I want to send each file post automatically, with let's say a break of 5 seconds.

Is there a tool for that?

Using Linux x64 (xubuntu)

3

There are 3 best solutions below

0
On BEST ANSWER

How about a simple command line like

for file in *.txt; do POST http://host.domain.com < "$file"; sleep 5; done

The POST utility comes from the Ubuntu package libwww-perl but of course there are dozens of similar command line utilities which offer POSTing of contents to a given URL (wget, curl, …).

0
On

Use curl:

curl -X POST --form "[email protected]" http://your_url.com

insert this code inside 5 sec loop.

0
On

Use "wget" utility and made script which will execute wget every 5 seconds with different file