feat(session): 项目基本完成
- 新增热加载模块funcs.py - 新增文件加载模块files.py - 新增了日志打印 - 新增其他功能
This commit is contained in:
28
api.py
Normal file
28
api.py
Normal file
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env python
|
||||
# coding=utf-8
|
||||
|
||||
"""
|
||||
@author: chen wei
|
||||
@Software: PyCharm
|
||||
@contact: t6i888@163.com
|
||||
@file: api.py
|
||||
@date: 2024 2024/9/12 22:52
|
||||
@desc:
|
||||
"""
|
||||
from commons.session import Session
|
||||
|
||||
# session = requests.session()
|
||||
session = Session("https://jsonplaceholder.typicode.com")
|
||||
session.params = {
|
||||
'Content-Type': 'application/json;charset=utf-8'
|
||||
}
|
||||
|
||||
url = "/users"
|
||||
|
||||
payload = {}
|
||||
|
||||
# response = requests.request("POST", url, headers=headers, data=payload)
|
||||
response = session.get(url, json=payload)
|
||||
# print(response.text)
|
||||
# print(response.url)
|
||||
# print(response)
|
||||
Reference in New Issue
Block a user