Search code examples
linuxtestingposthttp-postsystem-testing

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


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)


Solution

  • 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, …).