-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
17 lines (12 loc) · 718 Bytes
/
Copy pathmain.py
File metadata and controls
17 lines (12 loc) · 718 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import click
from method_requests.make_requests import make_request
@click.command()
@click.option('--url', default='http://localhost:8000', help="Set the URL target")
@click.option('--mode', default='get', help="Set the mode of request")
@click.option('--params', default={}, help="Set the params to Get Request. Most be in JSON format.")
@click.option('--body', default={}, help="Set the body form data to Post Request. Most be in JSON format.")
@click.option('--headers', default={}, help='Set the headers to make a request. Most be in JSON format')
def cli(url, mode, params, body, headers):
make_request(url=url, mode=mode, params=params, body=body, headers=headers)
if __name__ == '__main__':
cli()