-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathargs.py
More file actions
15 lines (13 loc) · 983 Bytes
/
Copy pathargs.py
File metadata and controls
15 lines (13 loc) · 983 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import argparse
def get_args():
parser = argparse.ArgumentParser()
parser.add_argument('url', help='URL запроса')
parser.add_argument('-v', '--version', default='HTTP/1.1', dest='version', help='Версия HTTP')
parser.add_argument('-M', '--method', default='GET', dest='method', help='Метод запроса')
parser.add_argument('-H', '--header', default=[], action='append', dest='headers', help='HTTP заголовки')
parser.add_argument('-b', '--cookie', default=[], action='append', dest='cookies', help='Cookies')
parser.add_argument('-d', '--data', default=[], action='append', dest='data', help='Данные запроса')
parser.add_argument('-q', '--query', default=[], action='append', dest='queries', help='Параметры запроса')
parser.add_argument('-a, --authorization', default = None, dest = 'authorization', help = 'Basic авторизация')
args = parser.parse_args()
return args