New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[bug] request json body is a list #824
Comments
@moyanzhiyu 你直接使用 requests 库去请求有报错么? |
更新到最新版本 不会报错了 谢谢 但是现在最新版本 有另一个问题 teststeps:
- name: /v1/klcs/classes/70/teachers
request:
headers:
json:
- duty: 班主任
teacher_id: 297
method: POST 如果我直接在body里面放一个数组 就会报错 不让运行 ERROR [{'duty': '$duty_type0', 'teacher_id': '$teacher_id0'}] is not of type 'object' Failed validating 'type' in schema[0]: On instance: 但是之前版本可以跑的 |
我直接录制转换不管json还是yml都报错 |
{
"config": {
"name": "testcase description",
"variables": {}
},
"teststeps": [
{
"name": "/v1/klcs/classes/70/teachers",
"request": {
"url": "",
"method": "POST",
"headers": {
},
"json": [
{
"teacher_id": 297,
"duty": "班主任"
}
]
},
"validate": [
{
"eq": [
"status_code",
200
]
}
]
}
]
} |
@moyanzhiyu 你确定这个接口请求的 body 是一个 list 格式? |
嗯 确定是一个数组 |
request json 已支持 list 类型。 |
@debugtalk 可以再2.x版本同步修复这个问题么? 3.0由于httprunner的改动,之前的debugtalk文件需要从写 |
@LeeJian v3 已经兼容支持 v2 的用例格式了。 |
python3.8, hrun 3.1.1 runner = HttpRunner() runner.run(r'testcases/login/login.yml', mapping=mapping) |
我跟你一样遇到了相同的问题,我是在2.及的版本遇到的 |
你之前2.记得版本是可以的吗?也是一样这样写的吗,那你api那边是怎么写的呀 |
但是很多带参数的运行方式,随着不同版本,导致有的生效有的无效,很痛苦,不敢随意升级了都,也没有明确的些 |
问题描述
我们的新增接口只会返回status code,response中不会返回任何。用postman直接调用是返回的200.
但是使用httprunner的话就报错
版本信息
请提供如下版本信息:
报错信息
Traceback (most recent call last):
ValueError: invalid literal for int() with base 16: b''
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
http.client.IncompleteRead: IncompleteRead(0 bytes read)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
urllib3.exceptions.ProtocolError: ('Connection broken: IncompleteRead(0 bytes read)', IncompleteRead(0 bytes read))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
requests.exceptions.ChunkedEncodingError: ('Connection broken: IncompleteRead(0 bytes read)', IncompleteRead(0 bytes read))
The text was updated successfully, but these errors were encountered: