Skip to content

Commit

Permalink
docs http params
Browse files Browse the repository at this point in the history
  • Loading branch information
andgineer committed Apr 23, 2019
1 parent 96a9f73 commit a5a277c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
2 changes: 2 additions & 0 deletions bombard/bombardier.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def apply_supply(request: dict, supply: dict) -> dict:
"""
Use supply to substitute all {name} in request strings.
"""
#todo: use eval with supply and args context
for name in request:
if isinstance(request[name], dict):
request[name] = apply_supply(request[name], supply)
Expand Down Expand Up @@ -73,6 +74,7 @@ def get_headers(request: dict) -> dict:
"""
Treat special value 'json' as Content-Type: application/json
"""
#todo: Auto add json if no header Content-Type and defined body
predefined = {
'json': {'Content-Type': 'application/json'},
}
Expand Down
22 changes: 22 additions & 0 deletions docs/campaign.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,28 @@ All sections are optional.
But you need section ``prepare`` or ``ammo`` so Bombard will
fire some requests.

HTTP parameters
---------------

All HTTP parameters but URL are optional.

.. code-block:: yaml
url: "{base}auth" # fully specified URL
method: POST # by default GET
body: # below is JSON object for request body
email: name@example.com
password: admin
headers:
json: # the same as Content-Type: "application/json"
Authorization: "Bearer {token}"
repeat
------

Override ``--repeat`` command line option. Number of repetitions
for the request.

supply
------

Expand Down

0 comments on commit a5a277c

Please sign in to comment.