A tool to accomplish some automatic HTTP requests, intended to help testing backend apps.
*Currently the methods available are: GET, POST, PUT, DELETE.
To start, clone this repository and enter it. All the commands needed will run inside the repo directory.
clone https://github.com/JeanCHilger/automated-requester.git
cd automated-requester
A parameter file is a .txt
file with the name of the desired HTTP parameter, that is, the name of a parameter file is in the form: parameter-key.txt
.
- If the required parameter needs to be a text (string) it won't have any identifier get some desired values for this key and put one in each line of the file, so the requester will choose one randomly, hence the parameters will be populated automatically.
- If the required parameter needs to be a random number it will be identified with the
__TYPE@RANDOMNUMBER__
"header". Put in the first line the minimun desired value and in the second the maximun desired value. - If the parameter must be a path variable it will be identified with the
__TYPE@PATHVAR__
"header". Just proceed as described in the two above items.
In order to use the core functionalities of 'automated-requester' you need to create a workspace.
Use ./requester.sh new <workspace-name>
to create new workspaces.
Inside a workspace you have the tools needed to configure requests for your apps (recommended use one workspace per app). Its possible to set URLs, data samples, curl
options, etc.
Once created, a workspace can be managed and configured using ./manage.sh <command>
(from inside). Most of the subcommands (related to configuration purposes) require a mandatory option -m <method>
to specify the targeted method.
The currently available commands are:
./manage.sh run <method>
: Sends the HTTP request for the specified<method>
../manage.sh showconfig <method>
: Displays the current configurations for the specified<method>
../manage.sh -h
: Prompts a help message with a list of available commands and their usage../manage.sh header <header> -m <method>
: Adds a header to<method>
configuration file../manage.sh param [opt] <path> -m <method>
: Adds a new parameter file from<path>
to the<method>
parameter list.opt
can be-p
for a path variable parameter,-r
for a random number parameter or-n
to create a new parameter file for the specified method.
./manage.sh url <url> -m <method>
: Sets the URL target for the request of the<method>
method../manage.sh verbose <option> -m <method>
: Whether or not use the verbose option (-v
) of thecurl
command when sending a<method>
request.
Note: Some of the data samples are from Moby Word Lists by Grady Ward.